util: add type check functions for BigInt arrays
Adds `isBigInt64Array` and `isBigUint64Array`. PR-URL: https://github.com/nodejs/node/pull/19201 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
24ec79627d
commit
01c9575ad5
@ -61,6 +61,14 @@ function isFloat64Array(value) {
|
||||
return TypedArrayProto_toStringTag(value) === 'Float64Array';
|
||||
}
|
||||
|
||||
function isBigInt64Array(value) {
|
||||
return TypedArrayProto_toStringTag(value) === 'BigInt64Array';
|
||||
}
|
||||
|
||||
function isBigUint64Array(value) {
|
||||
return TypedArrayProto_toStringTag(value) === 'BigUint64Array';
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isArrayBufferView,
|
||||
isTypedArray,
|
||||
@ -72,5 +80,7 @@ module.exports = {
|
||||
isInt16Array,
|
||||
isInt32Array,
|
||||
isFloat32Array,
|
||||
isFloat64Array
|
||||
isFloat64Array,
|
||||
isBigInt64Array,
|
||||
isBigUint64Array
|
||||
};
|
||||
|
@ -21,3 +21,5 @@ rules:
|
||||
# Global scoped methods and vars
|
||||
globals:
|
||||
WebAssembly: false
|
||||
BigInt64Array: false
|
||||
BigUint64Array: false
|
||||
|
@ -1,3 +1,4 @@
|
||||
// Flags: --harmony-bigint
|
||||
/* global SharedArrayBuffer */
|
||||
'use strict';
|
||||
const common = require('../common');
|
||||
@ -44,6 +45,8 @@ for (const [ value, _method ] of [
|
||||
[ new Int32Array() ],
|
||||
[ new Float32Array() ],
|
||||
[ new Float64Array() ],
|
||||
[ new BigInt64Array() ],
|
||||
[ new BigUint64Array() ],
|
||||
[ Object.defineProperty(new Uint8Array(),
|
||||
Symbol.toStringTag,
|
||||
{ value: 'foo' }) ],
|
||||
|
Loading…
x
Reference in New Issue
Block a user