Skip to content

Commit

Permalink
fixup! bootstrap: freeze more intrinsics
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Apr 15, 2021
1 parent 6e853e7 commit 131be4f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/internal/freeze_intrinsics.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ const {
decodeURIComponent,
encodeURI,
encodeURIComponent,
globalThis,
} = primordials;

module.exports = function() {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
/**
Expand Down

0 comments on commit 131be4f

Please sign in to comment.