Debian Codegraph @

js/src/jit-test/tests/self-hosting/is-constructor-on-wrapper.js

raw
1 var g = newGlobal();
2 var w = g.eval("() => {}");
3 var v = g.eval("Array");
4
5 try {
6 Reflect.construct(Array, [], w);
7 assertEq(true, false, "Expected exception above");
8 } catch (e) {
9 assertEq(e.constructor, TypeError);
10 }
11
12 try {
13 Reflect.construct(v, [], w);
14 assertEq(true, false, "Expected exception above");
15 } catch (e) {
16 assertEq(e.constructor, TypeError);
17 }