diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 8299e79a00eba0..6dc07df6df45c0 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: Map + message: "Use `const { Map } = primordials;` instead of the global." no-restricted-syntax: # Config copied from .eslintrc.js - error diff --git a/lib/assert.js b/lib/assert.js index e937fb159ea448..c703221c31e9f0 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -25,6 +25,7 @@ const { ObjectIs, ObjectKeys, ObjectPrototypeIsPrototypeOf, + Map, NumberIsNaN, RegExpPrototypeTest, } = primordials; diff --git a/lib/domain.js b/lib/domain.js index 4f340f20ec34c3..0c4a76d0f17a55 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -28,6 +28,7 @@ const { Array, + Map, ObjectDefineProperty, ReflectApply, Symbol, diff --git a/lib/fs.js b/lib/fs.js index d972c1465b910f..3810ad2e6ca916 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -25,6 +25,7 @@ 'use strict'; const { + Map, MathMax, NumberIsSafeInteger, ObjectCreate, diff --git a/lib/inspector.js b/lib/inspector.js index 203cd739a7ac06..269f95dbd27a12 100644 --- a/lib/inspector.js +++ b/lib/inspector.js @@ -3,6 +3,7 @@ const { JSONParse, JSONStringify, + Map, Symbol, } = primordials; diff --git a/lib/internal/bootstrap/loaders.js b/lib/internal/bootstrap/loaders.js index 1029d52de9f9b4..45f5c7376889ea 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -44,11 +44,12 @@ /* global process, getLinkedBinding, getInternalBinding, primordials */ const { - ReflectGet, + Map, ObjectCreate, ObjectDefineProperty, ObjectKeys, ObjectPrototypeHasOwnProperty, + ReflectGet, SafeSet, } = primordials; diff --git a/lib/internal/bootstrap/pre_execution.js b/lib/internal/bootstrap/pre_execution.js index 7af4be660fcc8b..1f4d5c04b9b9d5 100644 --- a/lib/internal/bootstrap/pre_execution.js +++ b/lib/internal/bootstrap/pre_execution.js @@ -1,6 +1,7 @@ 'use strict'; const { + Map, ObjectDefineProperty, SafeWeakMap, } = primordials; diff --git a/lib/internal/cluster/child.js b/lib/internal/cluster/child.js index ed5d7ce76dbc90..250a82ecabaa34 100644 --- a/lib/internal/cluster/child.js +++ b/lib/internal/cluster/child.js @@ -1,6 +1,7 @@ 'use strict'; const { + Map, ObjectAssign, } = primordials; diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js index bee224a67d9406..9bdb0181d3db93 100644 --- a/lib/internal/cluster/master.js +++ b/lib/internal/cluster/master.js @@ -1,6 +1,7 @@ 'use strict'; const { + Map, ObjectKeys, ObjectValues, } = primordials; diff --git a/lib/internal/cluster/round_robin_handle.js b/lib/internal/cluster/round_robin_handle.js index 61023b83705bcb..e89a309c79844c 100644 --- a/lib/internal/cluster/round_robin_handle.js +++ b/lib/internal/cluster/round_robin_handle.js @@ -2,6 +2,7 @@ const { Boolean, + Map, } = primordials; const assert = require('internal/assert'); diff --git a/lib/internal/cluster/utils.js b/lib/internal/cluster/utils.js index b6d572fd0ea44c..9e7a1186ffc2bf 100644 --- a/lib/internal/cluster/utils.js +++ b/lib/internal/cluster/utils.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Map, +} = primordials; + module.exports = { sendHelper, internal diff --git a/lib/internal/console/constructor.js b/lib/internal/console/constructor.js index aff24f93455c8b..65d0248a20d27b 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -7,6 +7,7 @@ const { ArrayFrom, ArrayIsArray, Boolean, + Map, MathFloor, Number, ObjectDefineProperties, diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js index 927fd5afc5a507..6cb840e9d1e84f 100644 --- a/lib/internal/encoding.js +++ b/lib/internal/encoding.js @@ -4,6 +4,7 @@ // https://encoding.spec.whatwg.org const { + Map, ObjectCreate, ObjectDefineProperties, ObjectGetOwnPropertyDescriptors, diff --git a/lib/internal/errors.js b/lib/internal/errors.js index 8b0a7a0d7aab66..d88bdb830f851e 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -12,6 +12,7 @@ const { ArrayIsArray, + Map, MathAbs, NumberIsInteger, ObjectDefineProperty, diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index 7e3f217617cef0..0cafd2ccda7d5f 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -5,6 +5,7 @@ const { ArrayFrom, ArrayIsArray, + Map, MathMin, ObjectAssign, ObjectCreate, diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js index 19cbc7ab54d653..70d999e050e8a4 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -24,6 +24,7 @@ const { ArrayIsArray, JSONParse, + Map, ObjectCreate, ObjectDefineProperty, ObjectFreeze, diff --git a/lib/internal/process/signal.js b/lib/internal/process/signal.js index 6929c73c51f41c..abc2b93dbfb7f3 100644 --- a/lib/internal/process/signal.js +++ b/lib/internal/process/signal.js @@ -1,5 +1,9 @@ 'use strict'; +const { + Map, +} = primordials; + const { errnoException, } = require('internal/errors'); diff --git a/lib/internal/source_map/source_map_cache.js b/lib/internal/source_map/source_map_cache.js index 8211e51e3ec413..48307dc7ec6233 100644 --- a/lib/internal/source_map/source_map_cache.js +++ b/lib/internal/source_map/source_map_cache.js @@ -6,6 +6,7 @@ const { ObjectKeys, ObjectGetOwnPropertyDescriptor, ObjectPrototypeHasOwnProperty, + Map, MapPrototypeEntries, WeakMapPrototypeGet, uncurryThis, diff --git a/lib/internal/util.js b/lib/internal/util.js index 8d4f66a0be26ff..16bce5db32bb33 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -3,6 +3,7 @@ const { ArrayFrom, ArrayIsArray, + Map, ObjectCreate, ObjectDefineProperties, ObjectDefineProperty, diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 0d59f37ad846e5..82ab16447e648e 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -5,6 +5,7 @@ const { BigIntPrototypeValueOf, BooleanPrototypeValueOf, DatePrototypeGetTime, + Map, NumberIsNaN, NumberPrototypeValueOf, ObjectGetOwnPropertySymbols, diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index 7054e35477e172..30b79c436b94c0 100644 --- a/lib/internal/util/inspect.js +++ b/lib/internal/util/inspect.js @@ -10,6 +10,7 @@ const { DatePrototypeToString, ErrorPrototypeToString, JSONStringify, + Map, MapPrototype, MapPrototypeEntries, MathFloor, diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 3fb06f4e93dfa1..ba9753e74b5afb 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -3,6 +3,7 @@ const { ArrayIsArray, Boolean, + Map, NumberIsSafeInteger, ObjectDefineProperties, ObjectDefineProperty, diff --git a/lib/v8.js b/lib/v8.js index c328a3c573275c..8f8f061255f143 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -22,6 +22,7 @@ const { Int16Array, Int32Array, Int8Array, + Map, ObjectPrototypeToString, Symbol, Uint16Array,