From 4bba27935ae6439c64858157d64887e5dcd01585 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 882ad837fb1034..be2e16749134bb 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -171,9 +171,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`);