Skip to content

Commit

Permalink
lib: enforce use of primordial Number
Browse files Browse the repository at this point in the history
PR-URL: #30700
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Sebastien-Ahkrin authored and BethGriggs committed Feb 6, 2020
1 parent 099edea commit 8f911fe
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/internal/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
MathFloor,
Number,
} = primordials;

const {
Expand Down
1 change: 1 addition & 0 deletions lib/internal/fs/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
ArrayIsArray,
DateNow,
Number,
NumberIsFinite,
ObjectSetPrototypeOf,
ReflectOwnKeys,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/http2/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
ArrayIsArray,
MathMax,
Number,
ObjectCreate,
ObjectKeys,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/repl.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {
Number,
NumberIsNaN,
ObjectCreate,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
Array,
Number,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const {
MathMin,
MathRound,
MathSqrt,
Number,
NumberIsNaN,
NumberPrototypeValueOf,
ObjectAssign,
Expand All @@ -39,7 +40,7 @@ const {
SymbolPrototypeValueOf,
SymbolIterator,
SymbolToStringTag,
uncurryThis
uncurryThis,
} = primordials;

const {
Expand Down
1 change: 1 addition & 0 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
const {
ArrayIsArray,
Boolean,
Number,
NumberIsNaN,
ObjectDefineProperty,
ObjectSetPrototypeOf,
Expand Down

0 comments on commit 8f911fe

Please sign in to comment.