-
Notifications
You must be signed in to change notification settings - Fork 24.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix babel-plugin-codegen crash when export init is null #33387
Conversation
Base commit: 2829146 |
@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
hi @janicduplessis, can you rebase your changes? i will go for the land when possible. thanks for working on this! |
f643d49
to
05fff59
Compare
@philIip done! |
Base commit: 2829146 |
@philIip has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
This pull request was successfully merged by @janicduplessis in ae75664. When will my fix make it into a release? | Upcoming Releases |
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: facebook#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
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: facebook#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
Summary
It is possible that
init
is null when using the following code.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
This simply adds a null check.
Changelog
[General] [Fixed] - Fix babel-plugin-codegen crash when export init is null
Test Plan
Tested that this fixed the crash in an app.