-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: In this diff, we add support for [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis). According to the spec, it refers to the global scope, which means that `globalThis.foo` means access of the `foo` global. In Flow, we can model it as a globally available namespace that contains all the other globals, plus the self referential `globalThis`. We only need to do it in type sig, since global libdef types are generated with type sig. In the validation of libdefs in checking, it will read the globalThis in the global libdef. Since there is no obvious location for this, I give it `Loc.none`. The tests added ensure that no IDE services will break. Close #7536 Close #7704 Changelog: [feature] Flow now supports [`globalThis`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis). Reviewed By: panagosg7 Differential Revision: D59083293 fbshipit-source-id: d1bf7ce965549df5801c6fa063ae20b32e6472bb
- Loading branch information
1 parent
dce378a
commit 0fe573e
Showing
16 changed files
with
1,011 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.