Skip to content

Commit 3f21ad6

Browse files
Sebastien-Ahkrintargos
authored andcommitted
lib: replace Set global by the primordials
PR-URL: #31154 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[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 542aae4 commit 3f21ad6

File tree

15 files changed

+19
-0
lines changed

15 files changed

+19
-0
lines changed

lib/.eslintrc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ rules:
2727
message: "Use `const { Promise } = primordials;` instead of the global."
2828
- name: Reflect
2929
message: "Use `const { Reflect } = primordials;` instead of the global."
30+
- name: Set
31+
message: "Use `const { Set } = primordials;` instead of the global."
3032
- name: Symbol
3133
message: "Use `const { Symbol } = primordials;` instead of the global."
3234
- name: WeakMap

lib/_stream_readable.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const {
2727
NumberIsNaN,
2828
ObjectDefineProperties,
2929
ObjectSetPrototypeOf,
30+
Set,
3031
SymbolAsyncIterator,
3132
Symbol
3233
} = primordials;

lib/internal/fs/rimraf.js

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

99
const {
1010
Promise,
11+
Set,
1112
} = primordials;
1213

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

lib/internal/http2/core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212
ObjectPrototypeHasOwnProperty,
1313
Promise,
1414
ReflectGetPrototypeOf,
15+
Set,
1516
Symbol,
1617
} = primordials;
1718

lib/internal/http2/util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const {
66
Number,
77
ObjectCreate,
88
ObjectKeys,
9+
Set,
910
Symbol,
1011
} = primordials;
1112

lib/internal/inspector_async_hook.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
let hook;
44
let config;
55

6+
const {
7+
Set,
8+
} = primordials;
9+
610
function lazyHookCreation() {
711
const inspector = internalBinding('inspector');
812
const { createHook } = require('async_hooks');

lib/internal/modules/esm/create_dynamic_module.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const {
55
ArrayPrototypeMap,
66
JSONStringify,
77
ObjectCreate,
8+
Set,
89
} = primordials;
910

1011
const debug = require('internal/util/debuglog').debuglog('esm');

lib/internal/process/per_thread.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212
ObjectFreeze,
1313
ObjectGetOwnPropertyDescriptors,
1414
RegExpPrototypeTest,
15+
Set,
1516
SetPrototype,
1617
SetPrototypeHas,
1718
StringPrototypeReplace,

lib/internal/repl/utils.js

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

33
const {
44
MathMin,
5+
Set,
56
Symbol,
67
} = primordials;
78

lib/internal/util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ const {
1212
ObjectSetPrototypeOf,
1313
Promise,
1414
ReflectConstruct,
15+
Set,
1516
Symbol,
1617
SymbolFor,
1718
} = primordials;

0 commit comments

Comments
 (0)