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
2019-03-14 12:36:59 +01:00
parent 6e678b1b59
commit 6d090124fd

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
);