Debian Codegraph @

js/src/jit-test/tests/modules/bug-1933039.js

raw
1
2 var threw = false;
3 try {
4 getModuleEnvironmentNames(parseModule("{}", "", "json"))
5 } catch (e) {
6 threw = true;
7 assertEq(e instanceof Error, true, "expected Error");
8 }
9 assertEq(threw, true, "expected an exception thrown");
10
11 var m = registerModule("m", parseModule('{"test": "foo"}', "", "json"));
12 moduleLink(m);
13 moduleEvaluate(m);
14
15 threw = false;
16 try {
17 getModuleEnvironmentValue(m, 'default');
18 } catch (e) {
19 threw = true;
20 assertEq(e instanceof Error, true, "expected Error");
21 }
22 assertEq(threw, true, "expected an exception thrown");