diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-01-29 23:15:01 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-29 15:15:01 +0100 |
commit | 266915d5ce354fde12b20f8f5ceb5ffdfacb7983 (patch) | |
tree | 8787d5b36ede178cd691492c5fdaab6b686b9f5f /ext/webidl/00_webidl.js | |
parent | 04ba709b6ec994fd084e0d09ff9edc9df3a1eefc (diff) |
fix(ext): internal `structuredClone` for `ArrayBuffer` and `TypedArray` subclasses (#17431)
Diffstat (limited to 'ext/webidl/00_webidl.js')
-rw-r--r-- | ext/webidl/00_webidl.js | 8 |
1 files changed, 7 insertions, 1 deletions
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); } |