Skip to content

Commit 131be4f

Browse files
committed
fixup! bootstrap: freeze more intrinsics
1 parent 6e853e7 commit 131be4f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/internal/freeze_intrinsics.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const {
120120
decodeURIComponent,
121121
encodeURI,
122122
encodeURIComponent,
123+
globalThis,
123124
} = primordials;
124125

125126
module.exports = function() {
@@ -219,8 +220,6 @@ module.exports = function() {
219220
ObjectGetOwnPropertyDescriptor(FunctionPrototype, 'caller').get,
220221

221222
// 19 The Global Object
222-
// 19.1 Value Properties of the Global Object
223-
globalThis, // eslint-disable-line no-restricted-globals
224223
// 19.2 Function Properties of the Global Object
225224
eval,
226225
// eslint-disable-next-line node-core/prefer-primordials
@@ -357,6 +356,13 @@ module.exports = function() {
357356
const frozenSet = new WeakSet();
358357
ArrayPrototypeForEach(intrinsics, deepFreeze);
359358

359+
// 19.1 Value Properties of the Global Object
360+
ObjectDefineProperty(globalThis, 'globalThis', {
361+
configurable: false,
362+
writable: false,
363+
value: globalThis,
364+
});
365+
360366
// Objects that are deeply frozen.
361367
function deepFreeze(root) {
362368
/**

0 commit comments

Comments
 (0)