| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent ba36ab7 commit 8cbd901
8 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ Last update: | |||
| 31 | 31 | - url: https://github.com/web-platform-tests/wpt/tree/d4598eba09/url | |
| 32 | 32 | - urlpattern: https://github.com/web-platform-tests/wpt/tree/11a459a2b1/urlpattern | |
| 33 | 33 | - user-timing: https://github.com/web-platform-tests/wpt/tree/5ae85bf826/user-timing | |
| 34 | - - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi | ||
| 34 | + - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/288c467d35/wasm/jsapi | ||
| 35 | 35 | - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi | |
| 36 | 36 | - web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks | |
| 37 | 37 | - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/03a1476844/WebCryptoAPI | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,7 +84,7 @@ | |||
| 84 | 84 | "path": "user-timing" | |
| 85 | 85 | }, | |
| 86 | 86 | "wasm/jsapi": { | |
| 87 | - "commit": "cde25e7e3c3b9d2280eb088a3fb9da988793d255", | ||
| 87 | + "commit": "288c467d350ec4b8e4fbc7f2ccb6119293186611", | ||
| 88 | 88 | "path": "wasm/jsapi" | |
| 89 | 89 | }, | |
| 90 | 90 | "wasm/webapi": { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,11 @@ | |||
| 1 | + (module | ||
| 2 | + (import "wasm:js/string-constants" "" (global $empty externref)) | ||
| 3 | + (import "wasm:js/string-constants" "\00" (global $null_byte externref)) | ||
| 4 | + (import "wasm:js/string-constants" "hello" (global $hello externref)) | ||
| 5 | + (import "wasm:js/string-constants" "\f0\9f\98\80" (global $emoji externref)) | ||
| 6 | + | ||
| 7 | + (export "empty" (global $empty)) | ||
| 8 | + (export "nullByte" (global $null_byte)) | ||
| 9 | + (export "hello" (global $hello)) | ||
| 10 | + (export "emoji" (global $emoji)) | ||
| 11 | + ) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,32 @@ | |||
| 1 | + // META: global=window,dedicatedworker,jsshell,shadowrealm | ||
| 2 | + | ||
| 3 | + promise_test(async () => { | ||
| 4 | + const wasmModuleSource = await import.source("./resources/js-string-constants.wasm"); | ||
| 5 | + | ||
| 6 | + const instance = new WebAssembly.Instance(wasmModuleSource, {}); | ||
| 7 | + | ||
| 8 | + assert_equals(instance.exports.empty.value, ""); | ||
| 9 | + assert_equals(instance.exports.nullByte.value, "\0"); | ||
| 10 | + assert_equals(instance.exports.hello.value, "hello"); | ||
| 11 | + assert_equals(instance.exports.emoji.value, "\u{1F600}"); | ||
| 12 | + }, "String constants from wasm:js/string-constants should be supported in source phase imports"); | ||
| 13 | + | ||
| 14 | + promise_test(async () => { | ||
| 15 | + const wasmModuleSource = await import.source("./resources/js-string-constants.wasm"); | ||
| 16 | + | ||
| 17 | + const exports = WebAssembly.Module.exports(wasmModuleSource); | ||
| 18 | + const exportNames = exports.map((exp) => exp.name); | ||
| 19 | + | ||
| 20 | + assert_true(exportNames.includes("empty")); | ||
| 21 | + assert_true(exportNames.includes("nullByte")); | ||
| 22 | + assert_true(exportNames.includes("hello")); | ||
| 23 | + assert_true(exportNames.includes("emoji")); | ||
| 24 | + }, "Source phase import should properly expose string constants exports"); | ||
| 25 | + | ||
| 26 | + promise_test(async () => { | ||
| 27 | + const wasmModuleSource = await import.source("./resources/js-string-constants.wasm"); | ||
| 28 | + | ||
| 29 | + const imports = WebAssembly.Module.imports(wasmModuleSource); | ||
| 30 | + | ||
| 31 | + assert_equals(imports.length, 0); | ||
| 32 | + }, "Source phase import should handle string constants import reflection correctly"); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,10 @@ | |||
| 1 | + // META: global=window,dedicatedworker,jsshell,shadowrealm | ||
| 2 | + | ||
| 3 | + promise_test(async () => { | ||
| 4 | + const wasmModule = await import("./resources/js-string-constants.wasm"); | ||
| 5 | + | ||
| 6 | + assert_equals(wasmModule.empty, ""); | ||
| 7 | + assert_equals(wasmModule.nullByte, "\0"); | ||
| 8 | + assert_equals(wasmModule.hello, "hello"); | ||
| 9 | + assert_equals(wasmModule.emoji, "\u{1F600}"); | ||
| 10 | + }, "String constants from wasm:js/string-constants should be supported in ESM integration"); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | function assert_throws_wasm(fn, message) { | |
| 5 | 5 | try { | |
| 6 | 6 | fn(); | |
| 7 | - assert_not_reached(`expected to throw with ${message}`); | ||
| 7 | + assert_unreached(`expected to throw with ${message}`); | ||
| 8 | 8 | } catch (e) { | |
| 9 | 9 | assert_true(e instanceof WebAssembly.Exception, `Error should be a WebAssembly.Exception with ${message}`); | |
| 10 | 10 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ test(() => { | |||
| 10 | 10 | }, "name"); | |
| 11 | 11 | ||
| 12 | 12 | test(() => { | |
| 13 | - assert_function_length(WebAssembly.Exception, 1, "WebAssembly.Exception"); | ||
| 13 | + assert_function_length(WebAssembly.Exception, 2, "WebAssembly.Exception"); | ||
| 14 | 14 | }, "length"); | |
| 15 | 15 | ||
| 16 | 16 | test(() => { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments