mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
lib: replace WeakMap global by the primordials
PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
committed by
Rich Trott
parent
e56840368b
commit
f509aaa7fa
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user