Harden window and navigator global property descriptors#57447
Open
rubennorte wants to merge 1 commit into
Open
Harden window and navigator global property descriptors#57447rubennorte wants to merge 1 commit into
window and navigator global property descriptors#57447rubennorte wants to merge 1 commit into
Conversation
Summary: The `window` and `navigator` globals were installed with plain property assignments, which produced writable and configurable data properties. This makes the global definitions safer and more spec-compliant: `window` is now non-writable and non-configurable (still enumerable), matching how browsers expose it, and `navigator` is now non-writable (still configurable and enumerable). `self` is unchanged and remains writable, configurable and enumerable. `window` and `self` are now installed on `globalThis`. Also adds Fantom tests that assert the property descriptors of the `window`, `self`, `navigator`, `Infinity`, `NaN` and `undefined` globals so these guarantees don't regress. Changelog: [General][Changed] - Make the `window` global non-writable and non-configurable, and the `navigator` global non-writable Differential Revision: D110759948
|
@rubennorte has exported this pull request. If you are a Meta employee, you can view the originating Diff in D110759948. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
The
windowandnavigatorglobals were installed with plain property assignments, which produced writable and configurable data properties. This makes the global definitions safer and more spec-compliant:windowis now non-writable and non-configurable (still enumerable), matching how browsers expose it, andnavigatoris now non-writable (still configurable and enumerable).selfis unchanged and remains writable, configurable and enumerable.windowandselfare now installed onglobalThis.Also adds Fantom tests that assert the property descriptors of the
window,self,navigator,Infinity,NaNandundefinedglobals so these guarantees don't regress.Changelog:
[General][Changed] - Make the
windowglobal non-writable and non-configurable, and thenavigatorglobal non-writableDifferential Revision: D110759948