Debian Codegraph @

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

raw
1 let { table, func } = wasmEvalText(`(module
2 (type (func))
3 (func (type 0))
4 (table 1 1 (ref 0) ref.func 0)
5 (export "table" (table 0))
6 (export "func" (func 0))
7 )`).exports;
8
9 // Check that the default value initializer worked
10 let element0 = table.get(0);
11 assertEq(element0, func);
12
13 // Set the first element to itself using the JS-API
14 // table[0] = table[0]
15 table.set(0, element0);
16
17 // Check that we didn't null out that value somehow
18 assertEq(element0, table.get(0));