summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/bug1586599.js
blob: a38f53037f0fef0ea41f37963f8a7d09483e0de5 (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
let m1 = parseModule(`
function x() {
    return 1;
}
function y() {
    x = function() { return 2; };
}
export { x, y };
`);
m1.declarationInstantiation();
m1.evaluation();

registerModule('m1', m1);

let m2 = parseModule(`
import {x, y} from "m1";

function test(expected) {
    for (var i = 0; i < 2000; i++) {
        if (i > 1900) {
            assertEq(x(), expected);
        }
    }
}
test(1);
y();
test(2);
`);
m2.declarationInstantiation();
m2.evaluation();