WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.13k stars 445 forks source link

Clarification regarding value parameter for WebAssembly.Global etc. #1660

Open manoskouk opened 1 year ago

manoskouk commented 1 year ago

Please confirm if the intended behavior for reference-typed WebAssembly.Global is the following:

and the omitted/undefined value behaves the same for table.new, table.set, table.grow.

eqrion commented 1 year ago

That is my understanding of WebAssembly.Global behavior. It's implied by the behavior of DefaultValue [1].

The Table JS-API methods also have this behavior as well.

[1] https://webassembly.github.io/spec/js-api/index.html#defaultvalue

Ms2ger commented 1 year ago

Hmm, as far as I can tell from https://webidl.spec.whatwg.org/#create-an-interface-object , the first two should be equivalent (ORA returns <WebAssembly.Global, [GlobalDescriptor { ... }, "missing"]>), but neither Chrome nor Firefox appears to implement that.

CC @annevk @domenic who might know where I misread.

annevk commented 1 year ago

Might be further fallout from engines not actually using Web IDL?