Skip to content

Commit 0dd8605

Browse files
Sebastien-Ahkrintargos
authored andcommitted
lib: replace Map global by the primordials
PR-URL: #31155 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: David Carlier <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent 02ed713 commit 0dd8605

23 files changed

+28
-1
lines changed

lib/.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ rules:
1919
message: "Use `const { Error } = primordials;` instead of the global."
2020
- name: JSON
2121
message: "Use `const { JSON } = primordials;` instead of the global."
22+
- name: Map
23+
message: "Use `const { Map } = primordials;` instead of the global."
2224
- name: Math
2325
message: "Use `const { Math } = primordials;` instead of the global."
2426
- name: Number

lib/assert.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const {
2525
ObjectAssign,
2626
ObjectIs,
2727
ObjectKeys,
28+
Map,
2829
} = primordials;
2930

3031
const { Buffer } = require('buffer');

lib/domain.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
const {
3030
Array,
3131
Error,
32+
Map,
3233
ObjectDefineProperty,
3334
ReflectApply,
3435
Symbol,

lib/fs.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
'use strict';
2626

2727
const {
28+
Map,
2829
MathMax,
2930
NumberIsSafeInteger,
3031
ObjectCreate,

lib/inspector.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
const {
44
JSONParse,
55
JSONStringify,
6+
Map,
67
Symbol,
78
} = primordials;
89

lib/internal/bootstrap/loaders.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,12 @@
4545

4646
const {
4747
Error,
48-
ReflectGet,
48+
Map,
4949
ObjectCreate,
5050
ObjectDefineProperty,
5151
ObjectKeys,
5252
ObjectPrototypeHasOwnProperty,
53+
ReflectGet,
5354
SafeSet,
5455
} = primordials;
5556

lib/internal/bootstrap/pre_execution.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
Map,
45
ObjectDefineProperty,
56
SafeWeakMap,
67
} = primordials;

lib/internal/cluster/child.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
Map,
45
ObjectAssign,
56
} = primordials;
67

lib/internal/cluster/master.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const {
4+
Map,
45
ObjectKeys,
56
ObjectValues,
67
} = primordials;

lib/internal/cluster/round_robin_handle.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const {
44
Boolean,
5+
Map,
56
} = primordials;
67

78
const assert = require('internal/assert');

0 commit comments

Comments
 (0)