| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a34c4ea commit 51ef025
13 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/258f285de0/url | |
| 32 | 32 | - urlpattern: https://github.com/web-platform-tests/wpt/tree/f07c03cbed/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/65a2134d50/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/8b5cd267b4/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": "65a2134d50", | ||
| 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 | |
|---|---|---|---|
@@ -37,3 +37,4 @@ promise_test(async () => { | |||
| 37 | 37 | ||
| 38 | 38 | assert_equals(imports.length, 0); | |
| 39 | 39 | }, "Source phase import should handle string builtin import reflection correctly"); | |
| 40 | + | ||
| 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 | |
|---|---|---|---|
@@ -10,3 +10,4 @@ promise_test(async () => { | |||
| 10 | 10 | assert_equals(wasmModule.testString("hello"), 1); | |
| 11 | 11 | assert_equals(wasmModule.testString(42), 0); | |
| 12 | 12 | }, "String builtins should be supported in imports in ESM integration"); | |
| 13 | + | ||
| 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 | // According to the spec discussion, the current `WebAssembly.Exception` does not have `[[ErrorData]]` semantically. | |
| 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