test: update WPT encoding tests

PR-URL: https://github.com/nodejs/node/pull/43958
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Feng Yu <F3n67u@outlook.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Kohei Ueno authored and GitHub committed 2022-07-25 16:12:05 +01:00
1 parent 9599700537
commit 536df6a439
15 files changed
+259 -22

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(() => {
const decoder = new TextDecoder('utf-8');
const buffer = new SharedArrayBuffer(4);
assert_throws_js(TypeError, () => {
decoder.decode(new Uint8Array(buffer));
}, 'constructing TextDecoder with SharedArrayBuffer view should throw');
}, 'decoding SharedArrayBuffer');
</script>