Skip to content

Commit

Permalink
test: update wasm/jsapi web platform tests
Browse files Browse the repository at this point in the history
PR-URL: nodejs#44100
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
anonrig authored and Fyko committed Sep 15, 2022
1 parent 38dd625 commit 96e7907
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/fixtures/wpt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Last update:
- streams: https://github.com/web-platform-tests/wpt/tree/8f60d94439/streams
- url: https://github.com/web-platform-tests/wpt/tree/0e5b126cd0/url
- user-timing: https://github.com/web-platform-tests/wpt/tree/df24fb604e/user-timing
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/1dd414c796/wasm/jsapi
- wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/d8dbe6990b/wasm/jsapi
- wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi
- WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/cdd0f03df4/WebCryptoAPI
- webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/a370aad338/webidl/ecmascript-binding/es-exceptions
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/wpt/versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"path": "user-timing"
},
"wasm/jsapi": {
"commit": "1dd414c79616489ea021c800eb0375a709e8114e",
"commit": "d8dbe6990bed03ec03beee25069a9347d4c3d6d5",
"path": "wasm/jsapi"
},
"wasm/webapi": {
Expand Down
5 changes: 5 additions & 0 deletions test/fixtures/wpt/wasm/jsapi/global/constructor.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ test(() => {
}
}, "Invalid type argument");

test(() => {
const argument = { "value": "v128" };
assert_throws_js(TypeError, () => new WebAssembly.Global(argument));
}, "Construct v128 global");

test(() => {
const argument = { "value": "i64" };
const global = new WebAssembly.Global(argument);
Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/wpt/wasm/jsapi/global/type.tentative.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ test(() => {
}, "externref, immutable")

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

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

test(() => {
const myglobal = new WebAssembly.Global({"value": "i32", "mutable": true});
Expand Down
8 changes: 4 additions & 4 deletions test/fixtures/wpt/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": "anyfunc"});
assert_type({ "minimum": 0, "element": "funcref"});
}, "Zero initial, no maximum");

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

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

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

0 comments on commit 96e7907

Please sign in to comment.