Skip to content

Commit

Permalink
Remove unnecessary global variable named GLOBAL
Browse files Browse the repository at this point in the history
Summary:
We are defining an alias for the global variable in React Native called `GLOBAL`, which is not used at all at Facebook and it doesn't seem it's used externally either. This alias is not standard nor common in the JS ecosystem, so we can just remove it to reduce the pollution of the global scope.

Changelog: [General][Removed] - Removed unnecessary global variable `GLOBAL`.

Reviewed By: yungsters

Differential Revision: D31472154

fbshipit-source-id: 127c3264848b638f85fb2e39e17ed2006372d2dd
  • Loading branch information
rubennorte authored and facebook-github-bot committed Oct 8, 2021
1 parent ec614c1 commit a101fc7
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions Libraries/Core/setUpGlobals.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
* Sets up global variables for React Native.
* You can use this module directly, or just require InitializeCore.
*/
if (global.GLOBAL === undefined) {
global.GLOBAL = global;
}

if (global.window === undefined) {
// $FlowFixMe[cannot-write]
global.window = global;
Expand Down

0 comments on commit a101fc7

Please sign in to comment.