From 266915d5ce354fde12b20f8f5ceb5ffdfacb7983 Mon Sep 17 00:00:00 2001 From: Kenta Moriuchi Date: Sun, 29 Jan 2023 23:15:01 +0900 Subject: fix(ext): internal `structuredClone` for `ArrayBuffer` and `TypedArray` subclasses (#17431) --- ext/webidl/00_webidl.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'ext/webidl/00_webidl.js') diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js index 4127d24bf..bb90d973e 100644 --- a/ext/webidl/00_webidl.js +++ b/ext/webidl/00_webidl.js @@ -77,6 +77,7 @@ Symbol, SymbolIterator, SymbolToStringTag, + TypedArrayPrototypeGetSymbolToStringTag, TypeError, Uint16Array, Uint32Array, @@ -442,6 +443,11 @@ return V; } + function isDataView(V) { + return ArrayBufferIsView(V) && + TypedArrayPrototypeGetSymbolToStringTag(V) === undefined; + } + function isNonSharedArrayBuffer(V) { return ObjectPrototypeIsPrototypeOf(ArrayBufferPrototype, V); } @@ -467,7 +473,7 @@ }; converters.DataView = (V, opts = {}) => { - if (!(ObjectPrototypeIsPrototypeOf(DataViewPrototype, V))) { + if (!isDataView(V)) { throw makeException(TypeError, "is not a DataView", opts); } -- cgit v1.2.3