Skip to content

Commit 984b965

Browse files
committed
Revert "lib: add globalThis to primordials"
This reverts commit 23d2c54.
1 parent 98c2067 commit 984b965

File tree

6 files changed

+0
-23
lines changed

6 files changed

+0
-23
lines changed

lib/.eslintrc.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ rules:
2525
message: "Please use `require('internal/errors').hideStackFrames()` instead."
2626
- selector: "AssignmentExpression:matches([left.name='prepareStackTrace'], [left.property.name='prepareStackTrace'])"
2727
message: "Use 'overrideStackTrace' from 'lib/internal/errors.js' instead of 'Error.prepareStackTrace'."
28-
no-restricted-globals:
29-
- error
30-
- name: globalThis
31-
message: "Use `const { globalThis } = primordials;` instead of the global."
3228
# Custom rules in tools/eslint-rules
3329
node-core/lowercase-name-for-primitive: error
3430
node-core/non-ascii-character: error

lib/internal/modules/esm/loader.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const {
99
RegExpPrototypeExec,
1010
SafeWeakMap,
1111
StringPrototypeStartsWith,
12-
globalThis,
1312
} = primordials;
1413

1514
const {

lib/internal/per_context/primordials.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,6 @@ function copyPrototype(src, dest, prefix) {
131131
}
132132
}
133133

134-
// Create copies of configurable value properties of the global object
135-
[
136-
'globalThis',
137-
].forEach((name) => {
138-
// eslint-disable-next-line no-restricted-globals
139-
primordials[name] = globalThis[name];
140-
});
141-
142134
// Create copies of URI handling functions
143135
[
144136
decodeURI,

lib/internal/process/execution.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
'use strict';
22

3-
const {
4-
globalThis,
5-
} = primordials;
6-
73
const path = require('path');
84

95
const {

lib/internal/test/binding.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
'use strict';
22

3-
const {
4-
globalThis,
5-
} = primordials;
6-
73
process.emitWarning(
84
'These APIs are for internal testing only. Do not use them.',
95
'internal/test/binding');

lib/internal/v8_prof_polyfill.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ function read(fileName) {
7272
}
7373
const quit = process.exit;
7474
// Polyfill "readline()".
75-
// eslint-disable-next-line no-restricted-globals
7675
const logFile = globalThis.arguments[globalThis.arguments.length - 1];
7776
try {
7877
fs.accessSync(logFile);
@@ -162,7 +161,6 @@ function macCppfiltNm(out) {
162161
});
163162
}
164163

165-
// eslint-disable-next-line no-restricted-globals
166164
Object.assign(globalThis, {
167165
os,
168166
print,

0 commit comments

Comments
 (0)