Debian Codegraph @

js/src/jit-test/tests/xdr/bug1790615.js

raw
1 // |jit-test| --fuzzing-safe; --cpu-count=2; --ion-offthread-compile=off; skip-if: !isAsmJSCompilationAvailable()
2
3 load(libdir + "asserts.js");
4
5 function asmCompile() {
6 var f = Function.apply(null, arguments);
7 return f;
8 }
9 var code = asmCompile('glob', 'imp', 'b', `
10 "use asm";
11 function f(i,j) {
12 i=i|0;
13 j=j|0;
14 }
15 return f
16 `);
17 let g80 = newGlobal({newCompartment: true});
18 // Compiling to a Stencil XDR should fail because XDR encoding does not support asm.js
19 assertThrowsInstanceOf(() => g80.compileToStencilXDR(code, {}), g80.Error);