test: fix intrinsics test

So far this test did not verify that the call did indeed fail since
the error case was not checked. This makes sure the error is indeed
thrown as expected.

PR-URL: https://github.com/nodejs/node/pull/26660
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This commit is contained in:
Ruben Bridgewater authored and Michaël Zasso committed 2019-03-27 21:59:02 +01:00
1 parent 8ba0da57a4
commit 31995e4cd2
1 file changed
+4 -5
+4 -5
View File
@@ -3,8 +3,7 @@
require('../common');
const assert = require('assert');
try {
Object.defineProperty = 'asdf';
assert(false);
} catch {
}
assert.throws(
() => Object.defineProperty = 'asdf',
TypeError
);