summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/bug1586599.js
blob: 612024678a5f2279c119241059d86adecd7ffc19 (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 };
`);
moduleLink(m1);
moduleEvaluate(m1);

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);
`);
moduleLink(m2);
moduleEvaluate(m2);