-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1623954 [wpt PR 22361] - Encoding: use Wasm to get a SharedArrayB…
…uffer instance, a=testonly Automatic update from web-platform-tests Encoding: use Wasm to get a SharedArrayBuffer instance For web-platform-tests/wpt#22358. -- wpt-commits: 4e83bff9e071561dd10538dda073cd2f43b68e4a wpt-pr: 22361
- Loading branch information
1 parent
ccd291b
commit 6c43e71
Showing
5 changed files
with
43 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const createBuffer = (() => { | ||
// See https://github.com/whatwg/html/issues/5380 for why not `new SharedArrayBuffer()` | ||
const sabConstructor = new WebAssembly.Memory({ shared:true, initial:0, maximum:0 }).buffer.constructor; | ||
return (type, length) => { | ||
if (type === "ArrayBuffer") { | ||
return new ArrayBuffer(length); | ||
} else if (type === "SharedArrayBuffer") { | ||
return new sabConstructor(length); | ||
} else { | ||
throw new Error("type has to be ArrayBuffer or SharedArrayBuffer"); | ||
} | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
testing/web-platform/tests/encoding/streams/decode-utf8.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 8 additions & 5 deletions
13
testing/web-platform/tests/encoding/textdecoder-copy.any.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters