Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix babel-plugin-codegen crash when export init is null (#33387)
Summary: It is possible that `init` is null when using the following code. ```js export var a; ``` The typescript compiler actually generates something like this for enums so a lot of third party libraries triggered this issue. For example in expo-apple-authentication/build/AppleAuthentication.types.js ```js export var AppleAuthenticationScope; (function (AppleAuthenticationScope) { AppleAuthenticationScope[AppleAuthenticationScope["FULL_NAME"] = 0] = "FULL_NAME"; AppleAuthenticationScope[AppleAuthenticationScope["EMAIL"] = 1] = "EMAIL"; })(AppleAuthenticationScope || (AppleAuthenticationScope = {})); ``` This simply adds a null check. ## Changelog [General] [Fixed] - Fix babel-plugin-codegen crash when export init is null Pull Request resolved: #33387 Test Plan: Tested that this fixed the crash in an app. Reviewed By: javache Differential Revision: D34687271 Pulled By: philIip fbshipit-source-id: 7a7e0fe1bb6a7a21a5b442af26b221a263d4173d
- Loading branch information