File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ const {
2323 SymbolIterator,
2424 TypeError,
2525 TypedArrayPrototypeGetBuffer,
26- TypedArrayPrototypeGetSymbolToStringTag,
2726} = primordials ;
2827
2928const {
@@ -36,6 +35,7 @@ const { kEmptyObject } = require('internal/util');
3635const {
3736 isArrayBuffer,
3837 isSharedArrayBuffer,
38+ isTypedArray,
3939} = require ( 'internal/util/types' ) ;
4040
4141const converters = { __proto__ : null } ;
@@ -392,12 +392,8 @@ function createInterfaceConverter(name, I) {
392392}
393393
394394// Returns the [[ViewedArrayBuffer]] of an ArrayBufferView without leaving JS.
395- // `TypedArrayPrototypeGetSymbolToStringTag` returns the concrete TypedArray
396- // name (e.g. 'Uint8Array') for any %TypedArray% instance, and `undefined`
397- // for a DataView, so it doubles as a branch-free dispatch between the two
398- // getters.
399395function getViewedArrayBuffer ( V ) {
400- return TypedArrayPrototypeGetSymbolToStringTag ( V ) !== undefined ?
396+ return isTypedArray ( V ) ?
401397 TypedArrayPrototypeGetBuffer ( V ) : DataViewPrototypeGetBuffer ( V ) ;
402398}
403399
You can’t perform that action at this time.
0 commit comments