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 <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>
  • Loading branch information
Sebastien-Ahkrin authored and targos committed Jan 14, 2020
1 parent 869cd53 commit e5b7d64
Show file tree
Hide file tree
Showing 13 changed files with 17 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/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 {
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/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,
} = primordials;
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 @@ -34,6 +34,7 @@ const {
ObjectPrototypePropertyIsEnumerable,
ObjectSeal,
RegExpPrototypeToString,
Set,
SetPrototypeValues,
StringPrototypeValueOf,
SymbolPrototypeToString,
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 @@ -57,6 +57,7 @@ const {
ObjectSetPrototypeOf,
Promise,
PromiseRace,
Set,
Symbol,
WeakMap,
WeakSet,
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 e5b7d64

Please sign in to comment.