From 71c6d44efa237d64d68c9ff0fc25c709c6d98b7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 10 Dec 2019 14:49:23 +0100 Subject: [PATCH] lib: enforce use of BigInt from primordials PR-URL: https://github.com/nodejs/node/pull/30882 Refs: https://github.com/nodejs/node/issues/30697 Reviewed-By: Colin Ihrig Reviewed-By: Shelley Vohr Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott Reviewed-By: Yongsheng Zhang --- lib/.eslintrc.yaml | 2 ++ lib/internal/buffer.js | 1 + lib/internal/fs/utils.js | 1 + 3 files changed, 4 insertions(+) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 0a5197e882b241..81042a5c9d6f27 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -11,6 +11,8 @@ rules: - error - name: Array message: "Use `const { Array } = primordials;` instead of the global." + - name: BigInt + message: "Use `const { BigInt } = primordials;` instead of the global." - name: Boolean message: "Use `const { Boolean } = primordials;` instead of the global." - name: JSON diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index 8d55f780fadc2d..ff703f11fd648e 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -1,6 +1,7 @@ 'use strict'; const { + BigInt, MathFloor, Number, } = primordials; diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index ac258bdb112876..f75e71a914c217 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -2,6 +2,7 @@ const { ArrayIsArray, + BigInt, DateNow, Number, NumberIsFinite,