From fad0630c73b7f73d031a42b31b74d1976ba3e82e Mon Sep 17 00:00:00 2001 From: Yagiz Nizipli Date: Tue, 2 Aug 2022 10:26:34 -0400 Subject: [PATCH] test: update wasm/jsapi web platform tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/44100 Reviewed-By: Feng Yu Reviewed-By: Michaƫl Zasso Reviewed-By: Luigi Pinca --- test/fixtures/wpt/README.md | 2 +- test/fixtures/wpt/versions.json | 2 +- test/fixtures/wpt/wasm/jsapi/global/constructor.any.js | 5 +++++ test/fixtures/wpt/wasm/jsapi/global/type.tentative.any.js | 8 ++++---- test/fixtures/wpt/wasm/jsapi/table/type.tentative.any.js | 8 ++++---- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/test/fixtures/wpt/README.md b/test/fixtures/wpt/README.md index 648298db082395..e20877de174d43 100644 --- a/test/fixtures/wpt/README.md +++ b/test/fixtures/wpt/README.md @@ -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 diff --git a/test/fixtures/wpt/versions.json b/test/fixtures/wpt/versions.json index 63fa4da214d049..ca900307b7a597 100644 --- a/test/fixtures/wpt/versions.json +++ b/test/fixtures/wpt/versions.json @@ -68,7 +68,7 @@ "path": "user-timing" }, "wasm/jsapi": { - "commit": "1dd414c79616489ea021c800eb0375a709e8114e", + "commit": "d8dbe6990bed03ec03beee25069a9347d4c3d6d5", "path": "wasm/jsapi" }, "wasm/webapi": { diff --git a/test/fixtures/wpt/wasm/jsapi/global/constructor.any.js b/test/fixtures/wpt/wasm/jsapi/global/constructor.any.js index f536f5d7b5df6c..dade7b1f55a433 100644 --- a/test/fixtures/wpt/wasm/jsapi/global/constructor.any.js +++ b/test/fixtures/wpt/wasm/jsapi/global/constructor.any.js @@ -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); diff --git a/test/fixtures/wpt/wasm/jsapi/global/type.tentative.any.js b/test/fixtures/wpt/wasm/jsapi/global/type.tentative.any.js index 173af647f27dc7..95adc2af0f6813 100644 --- a/test/fixtures/wpt/wasm/jsapi/global/type.tentative.any.js +++ b/test/fixtures/wpt/wasm/jsapi/global/type.tentative.any.js @@ -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}); diff --git a/test/fixtures/wpt/wasm/jsapi/table/type.tentative.any.js b/test/fixtures/wpt/wasm/jsapi/table/type.tentative.any.js index 596e10b6bf548e..ef1ceecb17d695 100644 --- a/test/fixtures/wpt/wasm/jsapi/table/type.tentative.any.js +++ b/test/fixtures/wpt/wasm/jsapi/table/type.tentative.any.js @@ -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");