Open manoskouk opened 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
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.
Might be further fallout from engines not actually using Web IDL?
Please confirm if the intended behavior for reference-typed WebAssembly.Global is the following:
new WebAssembly.Global({ "value": "anyfunc", "mutable": true}).value == null
new WebAssembly.Global({ "value": "anyfunc", "mutable": true}, undefined)
throws TypeErrornew WebAssembly.Global({ "value": "externref", "mutable": true}).value == undefined
and the omitted/
undefined
value behaves the same fortable.new
,table.set
,table.grow
.