diff options
author | Sebastien Ahkrin <sebastien48criquet@gmail.com> | 2019-11-28 10:30:51 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-11-30 13:58:25 +0100 |
commit | 2070d3f8eb14ca9cc5c2e23824b20d700d7183be (patch) | |
tree | 2624b2c21195851d06479bc2e5897a43d80beb25 | |
parent | 1f9a5ae7aadd073ac61933226687a4483f8eccf4 (diff) | |
download | node-new-2070d3f8eb14ca9cc5c2e23824b20d700d7183be.tar.gz |
lib: enforce use of primordial Number
PR-URL: https://github.com/nodejs/node/pull/30700
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
-rw-r--r-- | lib/.eslintrc.yaml | 2 | ||||
-rw-r--r-- | lib/internal/buffer.js | 1 | ||||
-rw-r--r-- | lib/internal/console/constructor.js | 1 | ||||
-rw-r--r-- | lib/internal/fs/utils.js | 1 | ||||
-rw-r--r-- | lib/internal/http2/util.js | 1 | ||||
-rw-r--r-- | lib/internal/repl.js | 1 | ||||
-rw-r--r-- | lib/internal/url.js | 1 | ||||
-rw-r--r-- | lib/internal/util/inspect.js | 3 | ||||
-rw-r--r-- | lib/net.js | 1 |
9 files changed, 11 insertions, 1 deletions
diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index d50f6f2f36..2823b7aa0d 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -17,6 +17,8 @@ rules: message: "Use `const { JSON } = primordials;` instead of the global." - name: Math message: "Use `const { Math } = primordials;` instead of the global." + - name: Number + message: "Use `const { Number } = primordials;` instead of the global." - name: Object message: "Use `const { Object } = primordials;` instead of the global." - name: Reflect diff --git a/lib/internal/buffer.js b/lib/internal/buffer.js index a14909e491..8d55f780fa 100644 --- a/lib/internal/buffer.js +++ b/lib/internal/buffer.js @@ -2,6 +2,7 @@ const { MathFloor, + Number, } = primordials; const { diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index 69dd4a6e4a..76b2066e9b 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -8,6 +8,7 @@ const { ArrayIsArray, Boolean, MathFloor, + Number, ObjectDefineProperties, ObjectDefineProperty, ObjectKeys, diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index c1dd1878ee..951030c5a5 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -3,6 +3,7 @@ const { ArrayIsArray, DateNow, + Number, NumberIsFinite, ObjectSetPrototypeOf, ReflectOwnKeys, diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index b43d6d421a..d97ce2f13f 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -3,6 +3,7 @@ const { ArrayIsArray, MathMax, + Number, ObjectCreate, ObjectKeys, } = primordials; diff --git a/lib/internal/repl.js b/lib/internal/repl.js index 75a68c8ea8..565ab049c7 100644 --- a/lib/internal/repl.js +++ b/lib/internal/repl.js @@ -1,6 +1,7 @@ 'use strict'; const { + Number, NumberIsNaN, ObjectCreate, } = primordials; diff --git a/lib/internal/url.js b/lib/internal/url.js index a30bcf5b98..3c75baf27b 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -2,6 +2,7 @@ const { Array, + Number, ObjectCreate, ObjectDefineProperties, ObjectDefineProperty, diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 0491d1e1e8..dde2066294 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -16,6 +16,7 @@ const { MathMin, MathRound, MathSqrt, + Number, NumberIsNaN, NumberPrototypeValueOf, ObjectAssign, @@ -39,7 +40,7 @@ const { SymbolPrototypeValueOf, SymbolIterator, SymbolToStringTag, - uncurryThis + uncurryThis, } = primordials; const { diff --git a/lib/net.js b/lib/net.js index db63a0cc9d..02fd187480 100644 --- a/lib/net.js +++ b/lib/net.js @@ -24,6 +24,7 @@ const { ArrayIsArray, Boolean, + Number, NumberIsNaN, ObjectDefineProperty, ObjectSetPrototypeOf, |