-
Notifications
You must be signed in to change notification settings - Fork 0
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 UltraBlame original commit: 401be49e000042c8161bbfc88ff20d8a493cb970
- Loading branch information
Showing
5 changed files
with
41 additions
and
23 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 = (() => { | ||
|
||
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
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