Debian Codegraph @

js/src/jit-test/tests/xdr/module-oom.js

raw
1 // OOM tests for xdr module parsing.
2
3 const sa =
4 `export default 20;
5 export let a = 22;
6 export function f(x, y) { return x + y }
7 `;
8
9 const sb =
10 `import x from "a";
11 import { a as y } from "a";
12 import * as ns from "a";
13 ns.f(x, y);
14 `;
15
16 oomTest(() => {
17 let stencil = compileToStencilXDR(sa, {module: true});
18 let m = instantiateModuleStencilXDR(stencil);
19 let a = registerModule('a', m);
20
21 stencil = compileToStencilXDR(sb, {module: true});
22 m = instantiateModuleStencilXDR(stencil);
23 let b = registerModule('b', m);
24 });