lib: replace Map global by the primordials

PR-URL: https://github.com/nodejs/node/pull/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>
pull/29744/merge
Sebastien Ahkrin 2020-01-02 14:43:02 +01:00 committed by Rich Trott
parent c9b93e2344
commit 9085c03806
23 changed files with 31 additions and 1 deletions

View File

@ -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

View File

@ -26,6 +26,7 @@ const {
ObjectIs,
ObjectKeys,
ObjectPrototypeIsPrototypeOf,
Map,
NumberIsNaN,
RegExpPrototypeTest,
} = primordials;

View File

@ -29,6 +29,7 @@
const {
Array,
Error,
Map,
ObjectDefineProperty,
ReflectApply,
Symbol,

View File

@ -25,6 +25,7 @@
'use strict';
const {
Map,
MathMax,
NumberIsSafeInteger,
ObjectCreate,

View File

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

View File

@ -45,11 +45,12 @@
const {
Error,
ReflectGet,
Map,
ObjectCreate,
ObjectDefineProperty,
ObjectKeys,
ObjectPrototypeHasOwnProperty,
ReflectGet,
SafeSet,
} = primordials;

View File

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

View File

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

View File

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

View File

@ -2,6 +2,7 @@
const {
Boolean,
Map,
} = primordials;
const assert = require('internal/assert');

View File

@ -1,5 +1,9 @@
'use strict';
const {
Map,
} = primordials;
module.exports = {
sendHelper,
internal

View File

@ -8,6 +8,7 @@ const {
ArrayIsArray,
Boolean,
Error,
Map,
MathFloor,
Number,
ObjectDefineProperties,

View File

@ -4,6 +4,7 @@
// https://encoding.spec.whatwg.org
const {
Map,
ObjectCreate,
ObjectDefineProperties,
ObjectGetOwnPropertyDescriptors,

View File

@ -13,6 +13,7 @@
const {
ArrayIsArray,
Error,
Map,
MathAbs,
NumberIsInteger,
ObjectDefineProperty,

View File

@ -5,6 +5,7 @@
const {
ArrayFrom,
ArrayIsArray,
Map,
MathMin,
ObjectAssign,
ObjectCreate,

View File

@ -25,6 +25,7 @@ const {
ArrayIsArray,
Error,
JSONParse,
Map,
ObjectCreate,
ObjectDefineProperty,
ObjectFreeze,

View File

@ -1,5 +1,9 @@
'use strict';
const {
Map,
} = primordials;
const {
errnoException,
} = require('internal/errors');

View File

@ -6,6 +6,7 @@ const {
ObjectKeys,
ObjectGetOwnPropertyDescriptor,
ObjectPrototypeHasOwnProperty,
Map,
MapPrototypeEntries,
WeakMap,
WeakMapPrototypeGet,

View File

@ -4,6 +4,7 @@ const {
ArrayFrom,
ArrayIsArray,
Error,
Map,
ObjectCreate,
ObjectDefineProperties,
ObjectDefineProperty,

View File

@ -6,6 +6,7 @@ const {
BooleanPrototypeValueOf,
DatePrototypeGetTime,
Error,
Map,
NumberIsNaN,
NumberPrototypeValueOf,
ObjectGetOwnPropertySymbols,

View File

@ -10,6 +10,7 @@ const {
DatePrototypeToString,
ErrorPrototypeToString,
JSONStringify,
Map,
MapPrototype,
MapPrototypeEntries,
MathFloor,

View File

@ -3,6 +3,7 @@
const {
ArrayIsArray,
Boolean,
Map,
NumberIsSafeInteger,
ObjectDefineProperties,
ObjectDefineProperty,

View File

@ -23,6 +23,7 @@ const {
Int16Array,
Int32Array,
Int8Array,
Map,
ObjectPrototypeToString,
Symbol,
Uint16Array,