From bf1238498844645cef022b13989176d975ecfefd Mon Sep 17 00:00:00 2001 From: Nikolai Vavilov Date: Sun, 10 Jun 2018 00:00:51 +0300 Subject: [PATCH] tools: add BigInt to globals PR-URL: https://github.com/nodejs/node/pull/21237 Reviewed-By: Gus Caplan Reviewed-By: Rich Trott Reviewed-By: Joyee Cheung Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto Reviewed-By: Ujjwal Sharma Reviewed-By: James M Snell --- .eslintrc.js | 1 + lib/internal/fs/utils.js | 1 - test/parallel/test-fs-stat-bigint.js | 2 -- 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index 53d0b39d0aea44..355a466455e4e2 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -243,6 +243,7 @@ module.exports = { 'node-core/no-unescaped-regexp-dot': 'error', }, globals: { + BigInt: false, COUNTER_HTTP_CLIENT_REQUEST: false, COUNTER_HTTP_CLIENT_RESPONSE: false, COUNTER_HTTP_SERVER_REQUEST: false, diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 7092bbcb633d81..7aa19605e92a6a 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -160,7 +160,6 @@ Stats.prototype._checkModeProperty = function(property) { return false; // Some types are not available on Windows } if (typeof this.mode === 'bigint') { // eslint-disable-line valid-typeof - // eslint-disable-next-line no-undef return (this.mode & BigInt(S_IFMT)) === BigInt(property); } return (this.mode & S_IFMT) === property; diff --git a/test/parallel/test-fs-stat-bigint.js b/test/parallel/test-fs-stat-bigint.js index 4030a06fae3bc8..6d0a064def5d25 100644 --- a/test/parallel/test-fs-stat-bigint.js +++ b/test/parallel/test-fs-stat-bigint.js @@ -31,7 +31,6 @@ function verifyStats(bigintStats, numStats) { `difference of ${key}.getTime() should < 2.\n` + `Number version ${time}, BigInt version ${time2}n`); } else if (key === 'mode') { - // eslint-disable-next-line no-undef assert.strictEqual(bigintStats[key], BigInt(val)); assert.strictEqual( bigintStats.isBlockDevice(), @@ -65,7 +64,6 @@ function verifyStats(bigintStats, numStats) { assert.strictEqual(bigintStats[key], undefined); assert.strictEqual(numStats[key], undefined); } else if (Number.isSafeInteger(val)) { - // eslint-disable-next-line no-undef assert.strictEqual(bigintStats[key], BigInt(val)); } else { assert(