Skip to content

Commit

Permalink
lib: replace Set global by the primordials
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Sebastien-Ahkrin authored and targos committed Jan 6, 2020
1 parent 542aae4 commit 3f21ad6
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ rules:
message: "Use `const { Promise } = primordials;` instead of the global."
- name: Reflect
message: "Use `const { Reflect } = primordials;` instead of the global."
- name: Set
message: "Use `const { Set } = primordials;` instead of the global."
- name: Symbol
message: "Use `const { Symbol } = primordials;` instead of the global."
- name: WeakMap
Expand Down
1 change: 1 addition & 0 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const {
NumberIsNaN,
ObjectDefineProperties,
ObjectSetPrototypeOf,
Set,
SymbolAsyncIterator,
Symbol
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/fs/rimraf.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

const {
Promise,
Set,
} = primordials;

const { Buffer } = require('buffer');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/http2/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
ObjectPrototypeHasOwnProperty,
Promise,
ReflectGetPrototypeOf,
Set,
Symbol,
} = primordials;

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 @@ -6,6 +6,7 @@ const {
Number,
ObjectCreate,
ObjectKeys,
Set,
Symbol,
} = primordials;

Expand Down
4 changes: 4 additions & 0 deletions lib/internal/inspector_async_hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
let hook;
let config;

const {
Set,
} = primordials;

function lazyHookCreation() {
const inspector = internalBinding('inspector');
const { createHook } = require('async_hooks');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/modules/esm/create_dynamic_module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const {
ArrayPrototypeMap,
JSONStringify,
ObjectCreate,
Set,
} = primordials;

const debug = require('internal/util/debuglog').debuglog('esm');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/process/per_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
ObjectFreeze,
ObjectGetOwnPropertyDescriptors,
RegExpPrototypeTest,
Set,
SetPrototype,
SetPrototypeHas,
StringPrototypeReplace,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/repl/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
MathMin,
Set,
Symbol,
} = primordials;

Expand Down
1 change: 1 addition & 0 deletions lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const {
ObjectSetPrototypeOf,
Promise,
ReflectConstruct,
Set,
Symbol,
SymbolFor,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/util/comparisons.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const {
ObjectPrototypeHasOwnProperty,
ObjectPrototypePropertyIsEnumerable,
ObjectPrototypeToString,
Set,
StringPrototypeValueOf,
SymbolPrototypeValueOf,
SymbolToStringTag,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/util/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const {
ObjectPrototypePropertyIsEnumerable,
ObjectSeal,
RegExpPrototypeToString,
Set,
SetPrototype,
SetPrototypeValues,
StringPrototypeValueOf,
Expand Down
1 change: 1 addition & 0 deletions lib/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,
Set,
Symbol,
} = primordials;

Expand Down
1 change: 1 addition & 0 deletions lib/repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ const {
ObjectSetPrototypeOf,
Promise,
PromiseRace,
Set,
Symbol,
WeakSet,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/trace_events.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
ArrayIsArray,
Set,
Symbol,
} = primordials;

Expand Down

0 comments on commit 3f21ad6

Please sign in to comment.