Skip to content

Commit d4d6172

Browse files
Sebastien-Ahkrintargos
authored andcommitted
lib: enforce use of primordial Number
PR-URL: #30700 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 5de272c commit d4d6172

File tree

8 files changed

+10
-1
lines changed

8 files changed

+10
-1
lines changed

lib/.eslintrc.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ rules:
1717
message: "Use `const { JSON } = primordials;` instead of the global."
1818
- name: Math
1919
message: "Use `const { Math } = primordials;` instead of the global."
20+
- name: Number
21+
message: "Use `const { Number } = primordials;` instead of the global."
2022
- name: Object
2123
message: "Use `const { Object } = primordials;` instead of the global."
2224
- name: Reflect

lib/internal/buffer.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
MathFloor,
5+
Number,
56
} = primordials;
67

78
const {

lib/internal/fs/utils.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const {
44
ArrayIsArray,
55
DateNow,
6+
Number,
67
NumberIsFinite,
78
ObjectSetPrototypeOf,
89
ReflectOwnKeys,

lib/internal/http2/util.js

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const {
44
ArrayIsArray,
55
MathMax,
6+
Number,
67
ObjectCreate,
78
ObjectKeys,
89
} = primordials;

lib/internal/repl.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
Number,
45
NumberIsNaN,
56
ObjectCreate,
67
} = primordials;

lib/internal/url.js

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
Array,
5+
Number,
56
ObjectCreate,
67
ObjectDefineProperties,
78
ObjectDefineProperty,

lib/internal/util/inspect.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const {
1616
MathMin,
1717
MathRound,
1818
MathSqrt,
19+
Number,
1920
NumberIsNaN,
2021
NumberPrototypeValueOf,
2122
ObjectAssign,
@@ -39,7 +40,7 @@ const {
3940
SymbolPrototypeValueOf,
4041
SymbolIterator,
4142
SymbolToStringTag,
42-
uncurryThis
43+
uncurryThis,
4344
} = primordials;
4445

4546
const {

lib/net.js

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
const {
2525
ArrayIsArray,
2626
Boolean,
27+
Number,
2728
NumberIsNaN,
2829
ObjectDefineProperty,
2930
ObjectSetPrototypeOf,

0 commit comments

Comments
 (0)