Skip to content

Commit 749b4fd

Browse files
aduh95bengl
authored andcommittedFeb 21, 2022
tools,lib: remove global and Intl from the list of globals
Refs: nodejs#38230 Refs: nodejs#38419 PR-URL: nodejs#42014 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Shingo Inoue <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent c3109f9 commit 749b4fd

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
 

‎lib/.eslintrc.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,7 @@ rules:
165165
- name: WeakSet
166166
into: Safe
167167
globals:
168-
Intl: false
169168
# Parameters passed to internal modules
170-
global: false
171169
require: false
172170
process: false
173171
exports: false

‎lib/internal/per_context/primordials.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function copyPrototype(src, dest, prefix) {
162162
'Reflect',
163163
].forEach((name) => {
164164
// eslint-disable-next-line no-restricted-globals
165-
copyPropsRenamed(global[name], primordials, name);
165+
copyPropsRenamed(globalThis[name], primordials, name);
166166
});
167167

168168
// Create copies of intrinsic objects
@@ -206,7 +206,7 @@ function copyPrototype(src, dest, prefix) {
206206
'WeakSet',
207207
].forEach((name) => {
208208
// eslint-disable-next-line no-restricted-globals
209-
const original = global[name];
209+
const original = globalThis[name];
210210
primordials[name] = original;
211211
copyPropsRenamed(original, primordials, name);
212212
copyPrototype(original.prototype, primordials, `${name}Prototype`);
@@ -219,7 +219,7 @@ function copyPrototype(src, dest, prefix) {
219219
'Promise',
220220
].forEach((name) => {
221221
// eslint-disable-next-line no-restricted-globals
222-
const original = global[name];
222+
const original = globalThis[name];
223223
primordials[name] = original;
224224
copyPropsRenamedBound(original, primordials, name);
225225
copyPrototype(original.prototype, primordials, `${name}Prototype`);

0 commit comments

Comments
 (0)
Please sign in to comment.