Closed yurydelendik closed 1 year ago
Inside Wasm, the default value for all (nullable) reference types is null, so I would expect the same here.
https://webassembly.github.io/function-references/js-api/index.html#defaultvalue points to ToWebAssemblyValue(undefined, valuetype)
for externref. And https://webassembly.github.io/function-references/js-api/index.html#towebassemblyvalue does not really explain what undefined is mapped to.
Moving discussion about externref
to https://github.com/WebAssembly/spec/issues/1620
Currently, there is a test in SM codebase:
With changes in how the
init
parameter works in the objects constructors (andgrow
method, and maybeset
one), we are treatingexternref
andfuncref
differently. TheDefaultValue
s for these two are different. If I read the JS-API spec correctly, theexternref
default value isundefined
, and thefuncref
isnull
.What is the right value for
g.value
with the current spec? Will the function-references proposal change the behavior?