summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/xdr/module-exports.js
blob: 2c1bff317262109f97c4115c51494138f4e1f982 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const count = 10;

let s = "";
for (let i = 0; i < count; i++)
    s += "export let e" + i + " = " + (i * i) + ";\n";
let stencil = compileToStencilXDR(s, {module: true});
let m = instantiateModuleStencilXDR(stencil);
let a = registerModule('a', m);

stencil = compileToStencilXDR("import * as ns from 'a'", {module: true});
m = instantiateModuleStencilXDR(stencil);
let b = registerModule('b', m);

moduleLink(b);
moduleEvaluate(b);

let ns = a.namespace;
for (let i = 0; i < count; i++)
    assertEq(ns["e" + i], i * i);