Skip to content

Commit

Permalink
lib: replace Map global by the primordials
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien-Ahkrin committed Jan 4, 2020
1 parent e9695d9 commit 01c67c7
Show file tree
Hide file tree
Showing 23 changed files with 31 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const {
ObjectIs,
ObjectKeys,
ObjectPrototypeIsPrototypeOf,
Map,
NumberIsNaN,
RegExpPrototypeTest,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

const {
Array,
Map,
ObjectDefineProperty,
ReflectApply,
Symbol,
Expand Down
1 change: 1 addition & 0 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
'use strict';

const {
Map,
MathMax,
NumberIsSafeInteger,
ObjectCreate,
Expand Down
1 change: 1 addition & 0 deletions lib/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
JSONParse,
JSONStringify,
Map,
Symbol,
} = primordials;

Expand Down
3 changes: 2 additions & 1 deletion lib/internal/bootstrap/loaders.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
/* global process, getLinkedBinding, getInternalBinding, primordials */

const {
ReflectGet,
Map,
ObjectCreate,
ObjectDefineProperty,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
ReflectGet,
SafeSet,
} = primordials;

Expand Down
1 change: 1 addition & 0 deletions lib/internal/bootstrap/pre_execution.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {
Map,
ObjectDefineProperty,
SafeWeakMap,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/cluster/child.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {
Map,
ObjectAssign,
} = primordials;

Expand Down
1 change: 1 addition & 0 deletions lib/internal/cluster/master.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

const {
Map,
ObjectKeys,
ObjectValues,
} = primordials;
Expand Down
1 change: 1 addition & 0 deletions lib/internal/cluster/round_robin_handle.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

const {
Boolean,
Map,
} = primordials;

const assert = require('internal/assert');
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/cluster/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

const {
Map,
} = primordials;

module.exports = {
sendHelper,
internal
Expand Down
1 change: 1 addition & 0 deletions lib/internal/console/constructor.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const {
ArrayFrom,
ArrayIsArray,
Boolean,
Map,
MathFloor,
Number,
ObjectDefineProperties,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/encoding.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// https://encoding.spec.whatwg.org

const {
Map,
ObjectCreate,
ObjectDefineProperties,
ObjectGetOwnPropertyDescriptors,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

const {
ArrayIsArray,
Map,
MathAbs,
NumberIsInteger,
ObjectDefineProperty,
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 @@ -5,6 +5,7 @@
const {
ArrayFrom,
ArrayIsArray,
Map,
MathMin,
ObjectAssign,
ObjectCreate,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
const {
ArrayIsArray,
JSONParse,
Map,
ObjectCreate,
ObjectDefineProperty,
ObjectFreeze,
Expand Down
4 changes: 4 additions & 0 deletions lib/internal/process/signal.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
'use strict';

const {
Map,
} = primordials;

const {
errnoException,
} = require('internal/errors');
Expand Down
1 change: 1 addition & 0 deletions lib/internal/source_map/source_map_cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const {
ObjectKeys,
ObjectGetOwnPropertyDescriptor,
ObjectPrototypeHasOwnProperty,
Map,
MapPrototypeEntries,
WeakMapPrototypeGet,
uncurryThis,
Expand Down
1 change: 1 addition & 0 deletions lib/internal/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
ArrayFrom,
ArrayIsArray,
Map,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
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 @@ -5,6 +5,7 @@ const {
BigIntPrototypeValueOf,
BooleanPrototypeValueOf,
DatePrototypeGetTime,
Map,
NumberIsNaN,
NumberPrototypeValueOf,
ObjectGetOwnPropertySymbols,
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 @@ -10,6 +10,7 @@ const {
DatePrototypeToString,
ErrorPrototypeToString,
JSONStringify,
Map,
MapPrototype,
MapPrototypeEntries,
MathFloor,
Expand Down
1 change: 1 addition & 0 deletions lib/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
const {
ArrayIsArray,
Boolean,
Map,
NumberIsSafeInteger,
ObjectDefineProperties,
ObjectDefineProperty,
Expand Down
1 change: 1 addition & 0 deletions lib/v8.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const {
Int16Array,
Int32Array,
Int8Array,
Map,
ObjectPrototypeToString,
Symbol,
Uint16Array,
Expand Down

0 comments on commit 01c67c7

Please sign in to comment.