From 53bbbc893233904c1286cd35a65a983b60f62ba7 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 18 Feb 2022 12:37:26 +0100 Subject: [PATCH] tools,lib: remove `global` and `Intl` from the list of globals Refs: https://github.com/nodejs/node/pull/38230 Refs: https://github.com/nodejs/node/pull/38419 PR-URL: https://github.com/nodejs/node/pull/42014 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Shingo Inoue Reviewed-By: Mestery Reviewed-By: Luigi Pinca Reviewed-By: Rich Trott --- lib/.eslintrc.yaml | 2 -- lib/internal/per_context/primordials.js | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index b06f12f5e2d701..2ccfecb57a5830 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -173,9 +173,7 @@ rules: - name: WeakSet into: Safe globals: - Intl: false # Parameters passed to internal modules - global: false require: false process: false exports: false diff --git a/lib/internal/per_context/primordials.js b/lib/internal/per_context/primordials.js index 7558fd25bd4984..2c0df17fbe1170 100644 --- a/lib/internal/per_context/primordials.js +++ b/lib/internal/per_context/primordials.js @@ -162,7 +162,7 @@ function copyPrototype(src, dest, prefix) { 'Reflect', ].forEach((name) => { // eslint-disable-next-line no-restricted-globals - copyPropsRenamed(global[name], primordials, name); + copyPropsRenamed(globalThis[name], primordials, name); }); // Create copies of intrinsic objects @@ -206,7 +206,7 @@ function copyPrototype(src, dest, prefix) { 'WeakSet', ].forEach((name) => { // eslint-disable-next-line no-restricted-globals - const original = global[name]; + const original = globalThis[name]; primordials[name] = original; copyPropsRenamed(original, primordials, name); copyPrototype(original.prototype, primordials, `${name}Prototype`); @@ -219,7 +219,7 @@ function copyPrototype(src, dest, prefix) { 'Promise', ].forEach((name) => { // eslint-disable-next-line no-restricted-globals - const original = global[name]; + const original = globalThis[name]; primordials[name] = original; copyPropsRenamedBound(original, primordials, name); copyPrototype(original.prototype, primordials, `${name}Prototype`);