Skip to content
Permalink
Browse files

lib: replace Map global by the primordials

PR-URL: #31155
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.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 f268621 commit 20ecb5dcfb0ea28576c83ce015c36e517c754b0d
@@ -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
@@ -26,6 +26,7 @@ const {
ObjectIs,
ObjectKeys,
ObjectPrototypeIsPrototypeOf,
Map,
RegExpPrototypeTest,
} = primordials;

@@ -29,6 +29,7 @@
const {
Array,
Error,
Map,
ObjectDefineProperty,
ReflectApply,
Symbol,
@@ -25,6 +25,7 @@
'use strict';

const {
Map,
MathMax,
NumberIsSafeInteger,
ObjectCreate,
@@ -3,6 +3,7 @@
const {
JSONParse,
JSONStringify,
Map,
Symbol,
} = primordials;

@@ -45,11 +45,12 @@

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

@@ -1,6 +1,7 @@
'use strict';

const {
Map,
ObjectDefineProperty,
SafeWeakMap,
} = primordials;
@@ -1,6 +1,7 @@
'use strict';

const {
Map,
ObjectAssign,
} = primordials;

@@ -1,6 +1,7 @@
'use strict';

const {
Map,
ObjectKeys,
ObjectValues,
} = primordials;
@@ -2,6 +2,7 @@

const {
Boolean,
Map,
} = primordials;

const assert = require('internal/assert');
@@ -1,5 +1,9 @@
'use strict';

const {
Map,
} = primordials;

module.exports = {
sendHelper,
internal
@@ -8,6 +8,7 @@ const {
ArrayIsArray,
Boolean,
Error,
Map,
MathFloor,
Number,
ObjectDefineProperties,
@@ -4,6 +4,7 @@
// https://encoding.spec.whatwg.org

const {
Map,
ObjectCreate,
ObjectDefineProperties,
ObjectGetOwnPropertyDescriptors,
@@ -13,6 +13,7 @@
const {
ArrayIsArray,
Error,
Map,
MathAbs,
NumberIsInteger,
ObjectDefineProperty,
@@ -5,6 +5,7 @@
const {
ArrayFrom,
ArrayIsArray,
Map,
MathMin,
ObjectAssign,
ObjectCreate,
@@ -25,6 +25,7 @@ const {
ArrayIsArray,
Error,
JSONParse,
Map,
ObjectCreate,
ObjectDefineProperty,
ObjectFreeze,
@@ -1,5 +1,9 @@
'use strict';

const {
Map,
} = primordials;

const {
errnoException,
} = require('internal/errors');
@@ -6,6 +6,7 @@ const {
ObjectKeys,
ObjectGetOwnPropertyDescriptor,
ObjectPrototypeHasOwnProperty,
Map,
MapPrototypeEntries,
WeakMap,
WeakMapPrototypeGet,
@@ -4,6 +4,7 @@ const {
ArrayFrom,
ArrayIsArray,
Error,
Map,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,
@@ -6,6 +6,7 @@ const {
BooleanPrototypeValueOf,
DatePrototypeGetTime,
Error,
Map,
NumberIsNaN,
NumberPrototypeValueOf,
ObjectGetOwnPropertySymbols,
@@ -10,6 +10,7 @@ const {
DatePrototypeToString,
ErrorPrototypeToString,
JSONStringify,
Map,
MapPrototype,
MapPrototypeEntries,
MathFloor,
@@ -3,6 +3,7 @@
const {
ArrayIsArray,
Boolean,
Map,
NumberIsSafeInteger,
ObjectDefineProperties,
ObjectDefineProperty,
@@ -23,6 +23,7 @@ const {
Int16Array,
Int32Array,
Int8Array,
Map,
ObjectPrototypeToString,
Symbol,
Uint16Array,

0 comments on commit 20ecb5d

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