From 74a93fdf63a17de990954399b10eb6dfe7dd1973 Mon Sep 17 00:00:00 2001 From: Andreu Botella Date: Thu, 28 Oct 2021 14:17:27 -0700 Subject: fix(webidl): Don't throw when converting a detached buffer source (#12585) The Web IDL conversion to `BufferSource` and similar types shouldn't check whether the buffer is detached. In the case of `TextDecoder`, our implementation would still throw after the Web IDL conversions because we're creating a new `Uint8Array` from the buffer source's buffer, which throws if it's detached. This change also fixes this bug. --- tools/wpt/expectation.json | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'tools/wpt') diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json index c80aeea25..d8931aefe 100644 --- a/tools/wpt/expectation.json +++ b/tools/wpt/expectation.json @@ -5908,7 +5908,6 @@ "api-surrogates-utf8.any.html": true, "api-surrogates-utf8.any.worker.html": true, "encodeInto.any.html": [ - "encodeInto() and a detached output buffer", "encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 0", "encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler 0", "encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 128", @@ -5953,7 +5952,6 @@ "encodeInto() into SharedArrayBuffer with ¥¥ and destination length 4, offset 4, filler random" ], "encodeInto.any.worker.html": [ - "encodeInto() and a detached output buffer", "encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 0", "encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 4, filler 0", "encodeInto() into SharedArrayBuffer with Hi and destination length 0, offset 0, filler 128", @@ -6028,14 +6026,8 @@ "decode-non-utf8.any.worker.html": true, "decode-split-character.any.html": true, "decode-split-character.any.worker.html": true, - "decode-utf8.any.html": [ - "decoding a transferred Uint8Array chunk should give no output", - "decoding a transferred ArrayBuffer chunk should give no output" - ], - "decode-utf8.any.worker.html": [ - "decoding a transferred Uint8Array chunk should give no output", - "decoding a transferred ArrayBuffer chunk should give no output" - ], + "decode-utf8.any.html": true, + "decode-utf8.any.worker.html": true, "encode-bad-chunks.any.html": true, "encode-bad-chunks.any.worker.html": true, "encode-utf8.any.html": true, -- cgit v1.2.3