The WebAssembly JS-API spec mentions the following types for globals:
enum ValueType {
"i32",
"i64",
"f32",
"f64",
"v128",
"externref",
"anyfunc",
};
However, both V8 and SpiderMonkey support multiple more values like "anyref" or "i31ref".
After some code-search in V8, I found my commit which added it in 2022 when anyref was introduced for wasm-gc as a separate type hierarchy vs. the existing externref.
In later changes we added more of these new types like i31ref probably assuming some kind of consistency to the already present anyref.
It seems that JavaScriptCore doesn't accept these values.
The wasm-gc JS API document does not list any extensions to these existing APIs.
So from a spec perspective, it looks like this is a bug in V8 and SpiderMonkey?
Was it a conscious decision to not add support for the new abstract heap types to the existing JS APIs?