Skip to content
Permalink
Browse files

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>
  • Loading branch information
Sebastien-Ahkrin authored and targos committed Jan 2, 2020
1 parent 542aae4 commit 3f21ad67f81d7f7e589662b0cb31aadbddcf03ec
@@ -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
@@ -27,6 +27,7 @@ const {
NumberIsNaN,
ObjectDefineProperties,
ObjectSetPrototypeOf,
Set,
SymbolAsyncIterator,
Symbol
} = primordials;
@@ -8,6 +8,7 @@

const {
Promise,
Set,
} = primordials;

const { Buffer } = require('buffer');
@@ -12,6 +12,7 @@ const {
ObjectPrototypeHasOwnProperty,
Promise,
ReflectGetPrototypeOf,
Set,
Symbol,
} = primordials;

@@ -6,6 +6,7 @@ const {
Number,
ObjectCreate,
ObjectKeys,
Set,
Symbol,
} = primordials;

@@ -3,6 +3,10 @@
let hook;
let config;

const {
Set,
} = primordials;

function lazyHookCreation() {
const inspector = internalBinding('inspector');
const { createHook } = require('async_hooks');
@@ -5,6 +5,7 @@ const {
ArrayPrototypeMap,
JSONStringify,
ObjectCreate,
Set,
} = primordials;

const debug = require('internal/util/debuglog').debuglog('esm');
@@ -12,6 +12,7 @@ const {
ObjectFreeze,
ObjectGetOwnPropertyDescriptors,
RegExpPrototypeTest,
Set,
SetPrototype,
SetPrototypeHas,
StringPrototypeReplace,
@@ -2,6 +2,7 @@

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

@@ -12,6 +12,7 @@ const {
ObjectSetPrototypeOf,
Promise,
ReflectConstruct,
Set,
Symbol,
SymbolFor,
} = primordials;
@@ -14,6 +14,7 @@ const {
ObjectPrototypeHasOwnProperty,
ObjectPrototypePropertyIsEnumerable,
ObjectPrototypeToString,
Set,
StringPrototypeValueOf,
SymbolPrototypeValueOf,
SymbolToStringTag,
@@ -33,6 +33,7 @@ const {
ObjectPrototypePropertyIsEnumerable,
ObjectSeal,
RegExpPrototypeToString,
Set,
SetPrototype,
SetPrototypeValues,
StringPrototypeValueOf,
@@ -7,6 +7,7 @@ const {
ObjectDefineProperties,
ObjectDefineProperty,
ObjectKeys,
Set,
Symbol,
} = primordials;

@@ -55,6 +55,7 @@ const {
ObjectSetPrototypeOf,
Promise,
PromiseRace,
Set,
Symbol,
WeakSet,
} = primordials;
@@ -2,6 +2,7 @@

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

0 comments on commit 3f21ad6

Please sign in to comment.
You can’t perform that action at this time.