Debian Codegraph @

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

raw
1 // |jit-test|
2 "use strict";
3
4 load(libdir + "asserts.js");
5
6 class UniqueError extends Error {}
7
8 let a = registerModule('a', parseModule(`
9 throw new UniqueError();
10 `));
11
12 let b = registerModule('b', parseModule(`
13 import * as ns0 from "a";
14 `));
15
16 moduleLink(a);
17 moduleEvaluate(a)
18 .then(r => {
19 // We should not reach here, as we expect an error to be thrown.
20 assertEq(false, true);
21 })
22 .catch(e => assertEq(e instanceof UniqueError, true));
23 moduleLink(b);
24 moduleEvaluate(b)
25 .then(r => {
26 // We should not reach here, as we expect an error to be thrown.
27 assertEq(false, true);
28 })
29 .catch(e => assertEq(e instanceof UniqueError, true));
30
31 drainJobQueue();