diff --git a/lib/internal/freeze_intrinsics.js b/lib/internal/freeze_intrinsics.js index 3ac7a4c98a057a..3e04c439395c56 100644 --- a/lib/internal/freeze_intrinsics.js +++ b/lib/internal/freeze_intrinsics.js @@ -120,6 +120,7 @@ const { decodeURIComponent, encodeURI, encodeURIComponent, + globalThis, } = primordials; module.exports = function() { @@ -219,8 +220,6 @@ module.exports = function() { ObjectGetOwnPropertyDescriptor(FunctionPrototype, 'caller').get, // 19 The Global Object - // 19.1 Value Properties of the Global Object - globalThis, // eslint-disable-line no-restricted-globals // 19.2 Function Properties of the Global Object eval, // eslint-disable-next-line node-core/prefer-primordials @@ -357,6 +356,13 @@ module.exports = function() { const frozenSet = new WeakSet(); ArrayPrototypeForEach(intrinsics, deepFreeze); + // 19.1 Value Properties of the Global Object + ObjectDefineProperty(globalThis, 'globalThis', { + configurable: false, + writable: false, + value: globalThis, + }); + // Objects that are deeply frozen. function deepFreeze(root) { /**