Skip to content
Permalink
Browse files

lib: replace WeakMap global by the primordials

PR-URL: #31158
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@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 1527796 commit 0b8eaf2e5cbf6dfab286dbf911b2fdcb7cce1b8a
@@ -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: WeakMap
message: "Use `const { WeakMap } = primordials;` instead of the global."
no-restricted-syntax:
# Config copied from .eslintrc.js
- error
@@ -17,6 +17,7 @@ const {
ReflectOwnKeys,
Symbol,
SymbolHasInstance,
WeakMap,
} = primordials;

const { trace } = internalBinding('trace_events');
@@ -18,6 +18,7 @@ const {
ObjectKeys,
Symbol,
SymbolFor,
WeakMap,
} = primordials;

const messages = new Map();
@@ -2,6 +2,7 @@

const {
ObjectDefineProperty,
WeakMap,
} = primordials;

const {
@@ -7,6 +7,7 @@ const {
ObjectGetOwnPropertyDescriptor,
ObjectPrototypeHasOwnProperty,
MapPrototypeEntries,
WeakMap,
WeakMapPrototypeGet,
uncurryThis,
} = primordials;
@@ -7,6 +7,7 @@ const {
ObjectDefineProperty,
SafePromise,
Symbol,
WeakMap,
} = primordials;

const { isContext } = internalBinding('contextify');

0 comments on commit 0b8eaf2

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