Debian Codegraph @

js/src/jit-test/tests/wasm/regress/bug1491322.js

raw
1 // |jit-test| skip-if: !wasmDebuggingEnabled()
2 var evalInFrame = (function(global) {
3 var dbgGlobal = newGlobal({newCompartment: true});
4 var dbg = new dbgGlobal.Debugger();
5 dbg.addDebuggee(global);
6 })(this);
7 const Module = WebAssembly.Module;
8 const Instance = WebAssembly.Instance;
9 var m = new Module(wasmTextToBinary(`(module
10 (import "" "foo" (func $foo (result i32)))
11 (import "" "bar" (func $bar (result i32)))
12 (table 3 funcref)
13 (func $baz (result i32) (i32.const 13))
14 (elem (i32.const 0) $foo $bar $baz)
15 (export "tbl" (table 0))
16 )`));
17 var jsFun = () => 83;
18 var wasmFun = new Instance(
19 new Module(
20 wasmTextToBinary('(module (func (result i32) (i32.const 42)) (export "foo" (func 0)))')
21 )
22 ).exports.foo;
23 var e1 = new Instance(m, {
24 "": {
25 foo: jsFun,
26 bar: wasmFun
27 }
28 }).exports;
29 var e2 = new Instance(m, {
30 "": {
31 foo: jsFun,
32 bar: jsFun
33 }
34 }).exports;
35 e2.tbl.get(0);