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 <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent 542aae4 commit 3f21ad6

15 files changed

+19
-0
lines changed

lib/.eslintrc.yaml

+2
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

+1
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

+1
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

+1
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

+1
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

+4
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

+1
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

+1
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

+1
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

+1
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;

lib/internal/util/comparisons.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const {
1414
ObjectPrototypeHasOwnProperty,
1515
ObjectPrototypePropertyIsEnumerable,
1616
ObjectPrototypeToString,
17+
Set,
1718
StringPrototypeValueOf,
1819
SymbolPrototypeValueOf,
1920
SymbolToStringTag,

lib/internal/util/inspect.js

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const {
3333
ObjectPrototypePropertyIsEnumerable,
3434
ObjectSeal,
3535
RegExpPrototypeToString,
36+
Set,
3637
SetPrototype,
3738
SetPrototypeValues,
3839
StringPrototypeValueOf,

lib/perf_hooks.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ const {
77
ObjectDefineProperties,
88
ObjectDefineProperty,
99
ObjectKeys,
10+
Set,
1011
Symbol,
1112
} = primordials;
1213

lib/repl.js

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ const {
5555
ObjectSetPrototypeOf,
5656
Promise,
5757
PromiseRace,
58+
Set,
5859
Symbol,
5960
WeakSet,
6061
} = primordials;

lib/trace_events.js

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

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

0 commit comments

Comments
 (0)