diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 8299e79a00eb..746305535708 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -29,6 +29,8 @@ rules: message: "Use `const { Reflect } = primordials;` instead of the global." - name: Symbol message: "Use `const { Symbol } = primordials;` instead of the global." + - name: Set + message: "Use `const { Set } = primordials;` instead of the global." no-restricted-syntax: # Config copied from .eslintrc.js - error diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index bda03cc15298..07db237514f4 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -27,6 +27,7 @@ const { NumberIsNaN, ObjectDefineProperty, ObjectSetPrototypeOf, + Set, SymbolAsyncIterator, Symbol } = primordials; diff --git a/lib/internal/fs/rimraf.js b/lib/internal/fs/rimraf.js index 02cdfdf4b5da..e88dd9697b19 100644 --- a/lib/internal/fs/rimraf.js +++ b/lib/internal/fs/rimraf.js @@ -8,6 +8,7 @@ const { Promise, + Set, } = primordials; const { Buffer } = require('buffer'); diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 7e3f217617ce..d4787332b245 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -12,6 +12,7 @@ const { ObjectPrototypeHasOwnProperty, Promise, ReflectGetPrototypeOf, + Set, Symbol, } = primordials; diff --git a/lib/internal/http2/util.js b/lib/internal/http2/util.js index 3bf3a8fdd56d..62ea60d06f4b 100644 --- a/lib/internal/http2/util.js +++ b/lib/internal/http2/util.js @@ -6,6 +6,7 @@ const { Number, ObjectCreate, ObjectKeys, + Set, Symbol, } = primordials; diff --git a/lib/internal/inspector_async_hook.js b/lib/internal/inspector_async_hook.js index b16e8d025ec9..a6112697cfda 100644 --- a/lib/internal/inspector_async_hook.js +++ b/lib/internal/inspector_async_hook.js @@ -3,6 +3,10 @@ let hook; let config; +const { + Set, +} = primordials; + function lazyHookCreation() { const inspector = internalBinding('inspector'); const { createHook } = require('async_hooks'); diff --git a/lib/internal/modules/esm/create_dynamic_module.js b/lib/internal/modules/esm/create_dynamic_module.js index f8e00fd2ad18..38344f69640e 100644 --- a/lib/internal/modules/esm/create_dynamic_module.js +++ b/lib/internal/modules/esm/create_dynamic_module.js @@ -5,6 +5,7 @@ const { ArrayPrototypeMap, JSONStringify, ObjectCreate, + Set, } = primordials; const debug = require('internal/util/debuglog').debuglog('esm'); diff --git a/lib/internal/process/per_thread.js b/lib/internal/process/per_thread.js index 2ead72781d53..107caba3d071 100644 --- a/lib/internal/process/per_thread.js +++ b/lib/internal/process/per_thread.js @@ -12,6 +12,7 @@ const { ObjectFreeze, ObjectGetOwnPropertyDescriptors, RegExpPrototypeTest, + Set, SetPrototypeHas, StringPrototypeReplace, } = primordials; diff --git a/lib/internal/repl/utils.js b/lib/internal/repl/utils.js index 75781be32b89..4da23e096c95 100644 --- a/lib/internal/repl/utils.js +++ b/lib/internal/repl/utils.js @@ -2,6 +2,7 @@ const { MathMin, + Set, Symbol, } = primordials; diff --git a/lib/internal/util.js b/lib/internal/util.js index 8d4f66a0be26..41af51a4c100 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -12,6 +12,7 @@ const { ObjectSetPrototypeOf, Promise, ReflectConstruct, + Set, Symbol, SymbolFor, } = primordials; diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 0d59f37ad846..3f9d2fc91fad 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -14,6 +14,7 @@ const { ObjectPrototypeHasOwnProperty, ObjectPrototypePropertyIsEnumerable, ObjectPrototypeToString, + Set, StringPrototypeValueOf, SymbolPrototypeValueOf, SymbolToStringTag, diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 7054e35477e1..168fd8a116e1 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -33,6 +33,7 @@ const { ObjectPrototypePropertyIsEnumerable, ObjectSeal, RegExpPrototypeToString, + Set, SetPrototype, SetPrototypeValues, StringPrototypeValueOf, diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 3fb06f4e93df..92ee414bf8d3 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -7,6 +7,7 @@ const { ObjectDefineProperties, ObjectDefineProperty, ObjectKeys, + Set, Symbol, } = primordials; diff --git a/lib/repl.js b/lib/repl.js index d9efb8c5ece5..7fce42a741c2 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -55,6 +55,7 @@ const { ObjectSetPrototypeOf, Promise, PromiseRace, + Set, Symbol, } = primordials; diff --git a/lib/trace_events.js b/lib/trace_events.js index 1ff2b5a4fb15..35f776ad53c3 100644 --- a/lib/trace_events.js +++ b/lib/trace_events.js @@ -2,6 +2,7 @@ const { ArrayIsArray, + Set, Symbol, } = primordials;