summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/bug-1476921.js
blob: 005099319fcc86431e6d6c1b2543f4a949716717 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// |jit-test|
"use strict";

load(libdir + "asserts.js");

class UniqueError extends Error {}

let a = registerModule('a', parseModule(`
    throw new UniqueError();
`));

let b = registerModule('b', parseModule(`
    import * as ns0 from "a";
`));

moduleLink(a);
moduleEvaluate(a)
  .then(r => {
    // We should not reach here, as we expect an error to be thrown.
    assertEq(false, true);
  })
  .catch(e => assertEq(e instanceof UniqueError, true));
moduleLink(b);
moduleEvaluate(b)
  .then(r => {
    // We should not reach here, as we expect an error to be thrown.
    assertEq(false, true);
  })
  .catch(e => assertEq(e instanceof UniqueError, true));

drainJobQueue();