spec icon indicating copy to clipboard operation
spec copied to clipboard

js-api tests broken after #1796

Open backes opened this issue 1 year ago • 9 comments

I don't have time to investigate this further currently (and my OCaml knowledge is limited), but after #1796 we now fail most tests in the memory64 and js-promise-integration repositories, which seem to be rebased on a branch which contains that change.

The resulting JS code looks like

// address.wast:3                                                           
let $$1 = "\x00\x61\x73\x6d [...] \x7a";

// address.wast:3
let $1 = instance($$1);

Where instance simply does:

function instance(mod, imports = registry) {
  return new WebAssembly.Instance(mod, imports);
}

This can't work.

To reproduce, run something like: make -C interpreter wasm && (cd test/core && ./run.py --wasm ../../interpreter/wasm --js $HOME/v8/out/Optdebug/d8 address.wast)

This produces an error like:

test/core/_output/address.js:62: TypeError: WebAssembly.Instance(): Argument 0 must be a WebAssembly.Module
  return new WebAssembly.Instance(mod, imports);
         ^
TypeError: WebAssembly.Instance(): Argument 0 must be a WebAssembly.Module
    at instance (test/core/_output/address.js:62:10)
    at test/core/_output/address.js:203:10

backes avatar Oct 07 '24 17:10 backes