Skip to content

Commit

Permalink
[wpt][wasm] Fix type string of function references
Browse files Browse the repository at this point in the history
The type string for function references is "anyfunc" and not "funcref",
see https://webassembly.github.io/spec/js-api/index.html#dom-valuetype-anyfunc.
This CL replaces the invalid "funcref" string with the valid "anyfunc"
string in the wasm/global/type... test.

Bug: v8:12227
Change-Id: I8c0709036beba3aa6e8418ca4fa9bc16fd67b914
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3162136
Commit-Queue: Andreas Haas <[email protected]>
Reviewed-by: Michael Lippautz <[email protected]>
Cr-Commit-Position: refs/heads/main@{#922052}
  • Loading branch information
gahaas authored and chromium-wpt-export-bot committed Sep 16, 2021
1 parent 38413c5 commit 0286e80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions wasm/jsapi/global/type.tentative.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ test(() => {

test(() => {
assert_type({"value": "externref", "mutable": true})
}, "anyref, mutable")
}, "externref, mutable")

test(() => {
assert_type({"value": "externref", "mutable": false})
}, "anyref, immutable")
}, "externref, immutable")

test(() => {
assert_type({"value": "funcref", "mutable": true})
}, "funcref, mutable")
assert_type({"value": "anyfunc", "mutable": true})
}, "anyfunc, mutable")

test(() => {
assert_type({"value": "funcref", "mutable": false})
}, "funcref, immutable")
assert_type({"value": "anyfunc", "mutable": false})
}, "anyfunc, immutable")

test(() => {
const myglobal = new WebAssembly.Global({"value": "i32", "mutable": true});
Expand Down
8 changes: 4 additions & 4 deletions wasm/jsapi/table/type.tentative.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ function assert_type(argument) {
}

test(() => {
assert_type({ "minimum": 0, "element": "funcref"});
assert_type({ "minimum": 0, "element": "anyfunc"});
}, "Zero initial, no maximum");

test(() => {
assert_type({ "minimum": 5, "element": "funcref" });
assert_type({ "minimum": 5, "element": "anyfunc" });
}, "Non-zero initial, no maximum");

test(() => {
assert_type({ "minimum": 0, "maximum": 0, "element": "funcref" });
assert_type({ "minimum": 0, "maximum": 0, "element": "anyfunc" });
}, "Zero maximum");

test(() => {
assert_type({ "minimum": 0, "maximum": 5, "element": "funcref" });
assert_type({ "minimum": 0, "maximum": 5, "element": "anyfunc" });
}, "None-zero maximum");

0 comments on commit 0286e80

Please sign in to comment.