diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 3f21aed7161cb4..04084df3fd9d57 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -19,6 +19,8 @@ rules: message: "Use `const { Error } = primordials;` instead of the global." - name: JSON message: "Use `const { JSON } = primordials;` instead of the global." + - name: Map + message: "Use `const { Map } = primordials;` instead of the global." - name: Math message: "Use `const { Math } = primordials;` instead of the global." - name: Number diff --git a/lib/assert.js b/lib/assert.js index 4b23d79d2673dc..554a74091b0447 100644 --- a/lib/assert.js +++ b/lib/assert.js @@ -26,6 +26,7 @@ const { ObjectIs, ObjectKeys, ObjectPrototypeIsPrototypeOf, + Map, RegExpPrototypeTest, } = primordials; diff --git a/lib/domain.js b/lib/domain.js index 9a07f22e66712b..f18823960cde02 100644 --- a/lib/domain.js +++ b/lib/domain.js @@ -29,6 +29,7 @@ const { Array, Error, + Map, ObjectDefineProperty, ReflectApply, Symbol, diff --git a/lib/fs.js b/lib/fs.js index 4ad3740ef11589..c63bc46bba0858 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 3308957e4a152e..c4ef1d12a2974c 100644 --- a/lib/internal/bootstrap/loaders.js +++ b/lib/internal/bootstrap/loaders.js @@ -45,11 +45,12 @@ const { Error, - 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 d9f3dc02133941..f1ba8fbbd7c7e6 100644 --- a/lib/internal/console/constructor.js +++ b/lib/internal/console/constructor.js @@ -8,6 +8,7 @@ const { ArrayIsArray, Boolean, Error, + 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 a4450dc0b05b4b..76f211c95bb373 100644 --- a/lib/internal/errors.js +++ b/lib/internal/errors.js @@ -13,6 +13,7 @@ const { ArrayIsArray, Error, + Map, MathAbs, NumberIsInteger, ObjectDefineProperty, diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index d4787332b24577..f912a65dd07932 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 beb983551be235..7ebbaad20cdbeb 100644 --- a/lib/internal/modules/cjs/loader.js +++ b/lib/internal/modules/cjs/loader.js @@ -25,6 +25,7 @@ const { ArrayIsArray, Error, 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 2d30d53db84c9e..593c2c8277f224 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, WeakMap, WeakMapPrototypeGet, diff --git a/lib/internal/util.js b/lib/internal/util.js index a2c647f1a9981c..5eb5ba9e966ff9 100644 --- a/lib/internal/util.js +++ b/lib/internal/util.js @@ -4,6 +4,7 @@ const { ArrayFrom, ArrayIsArray, Error, + Map, ObjectCreate, ObjectDefineProperties, ObjectDefineProperty, diff --git a/lib/internal/util/comparisons.js b/lib/internal/util/comparisons.js index 9cf2c9443994ff..1f1571ef082bc5 100644 --- a/lib/internal/util/comparisons.js +++ b/lib/internal/util/comparisons.js @@ -6,6 +6,7 @@ const { BooleanPrototypeValueOf, DatePrototypeGetTime, Error, + Map, NumberIsNaN, NumberPrototypeValueOf, ObjectGetOwnPropertySymbols, diff --git a/lib/internal/util/inspect.js b/lib/internal/util/inspect.js index bb41e1e9be5f3e..69ca4c9f88d62b 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 82fb66258b940b..267b4577ffee3d 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 ea99e14792114b..a648d995404836 100644 --- a/lib/v8.js +++ b/lib/v8.js @@ -23,6 +23,7 @@ const { Int16Array, Int32Array, Int8Array, + Map, ObjectPrototypeToString, Symbol, Uint16Array,