summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/dynamic-import-ion.js
blob: 9c8f5e0e40cf1a74c1e63ed8c17ffb7585219b14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Even with --ion-eager, this needs to be run twice before it executes the
// ion-compiled version.
for (let i = 0; i < 2; i++) {
    let result = null;
    let error = null;
    let promise = import("../../modules/module1.js");
    promise.then((ns) => {
        result = ns;
    }).catch((e) => {
        error = e;
    });

    drainJobQueue();
    assertEq(error, null);
    assertEq(result.a, 1);
}