From 7a794bb6f40366e9c6145d0aa8abd8588d521610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 13 Mar 2018 15:08:31 +0100 Subject: [PATCH] util: add type check function for BigIntObject Also exclude isBigInt from test because `typeof value === 'bigint'` can be used instead. --- src/node_types.cc | 1 + test/.eslintrc.yaml | 1 + test/parallel/test-util-types.js | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/node_types.cc b/src/node_types.cc index 4b9f86f0d54..99d5d239eea 100644 --- a/src/node_types.cc +++ b/src/node_types.cc @@ -13,6 +13,7 @@ namespace { V(External) \ V(Date) \ V(ArgumentsObject) \ + V(BigIntObject) \ V(BooleanObject) \ V(NumberObject) \ V(StringObject) \ diff --git a/test/.eslintrc.yaml b/test/.eslintrc.yaml index 235b73baf06..a505c86d746 100644 --- a/test/.eslintrc.yaml +++ b/test/.eslintrc.yaml @@ -21,5 +21,6 @@ rules: # Global scoped methods and vars globals: WebAssembly: false + BigInt: false BigInt64Array: false BigUint64Array: false diff --git a/test/parallel/test-util-types.js b/test/parallel/test-util-types.js index 68c6f86bb6d..c5a45b28ec3 100644 --- a/test/parallel/test-util-types.js +++ b/test/parallel/test-util-types.js @@ -23,6 +23,7 @@ for (const [ value, _method ] of [ [ new Number(), 'isNumberObject' ], [ new String(), 'isStringObject' ], [ Object(Symbol()), 'isSymbolObject' ], + [ Object(BigInt(0)), 'isBigIntObject' ], [ new Error(), 'isNativeError' ], [ new RegExp() ], [ async function() {}, 'isAsyncFunction' ], @@ -148,7 +149,7 @@ try { const exclude = [ 'Undefined', 'Null', 'NullOrUndefined', 'True', 'False', 'Name', 'String', 'Symbol', 'Function', 'Array', 'Object', 'Boolean', 'Number', 'Int32', - 'Uint32' + 'Uint32', 'BigInt' ]; const start = v8_h.indexOf('Value : public Data');