diff options
author | Kenta Moriuchi <moriken@kimamass.com> | 2023-02-10 06:45:47 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-09 22:45:47 +0100 |
commit | 8da235adced567839912344ba092fb445683485a (patch) | |
tree | bc20290768c305c7c32e0de0f2b0ff6a62a3cd08 /ext/webidl/00_webidl.js | |
parent | 717daf47482d370ed2bd868a36a33de93f1cf8b6 (diff) |
refactor(ext/webidl): use `TypedArrayPrototypeGetSymbolToStringTag` (#17602)
Diffstat (limited to 'ext/webidl/00_webidl.js')
-rw-r--r-- | ext/webidl/00_webidl.js | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/ext/webidl/00_webidl.js b/ext/webidl/00_webidl.js index 1357d308e..46d0a2c1d 100644 --- a/ext/webidl/00_webidl.js +++ b/ext/webidl/00_webidl.js @@ -486,14 +486,6 @@ converters.DataView = (V, opts = {}) => { return V; }; -// Returns the unforgeable `TypedArray` constructor name or `undefined`, -// if the `this` value isn't a valid `TypedArray` object. -// -// https://tc39.es/ecma262/#sec-get-%typedarray%.prototype-@@tostringtag -const typedArrayNameGetter = ObjectGetOwnPropertyDescriptor( - ObjectGetPrototypeOf(Uint8Array).prototype, - SymbolToStringTag, -).get; ArrayPrototypeForEach( [ Int8Array, @@ -510,7 +502,7 @@ ArrayPrototypeForEach( const name = func.name; const article = RegExpPrototypeTest(/^[AEIOU]/, name) ? "an" : "a"; converters[name] = (V, opts = {}) => { - if (!ArrayBufferIsView(V) || typedArrayNameGetter.call(V) !== name) { + if (TypedArrayPrototypeGetSymbolToStringTag(V) !== name) { throw makeException( TypeError, `is not ${article} ${name} object`, |