Skip to content
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 a bug for which is impossible to disable Hermes #34142

Closed
wants to merge 1 commit into from

Conversation

cipolleschi
Copy link
Contributor

Summary:
The ||= operator in an expression like x = a ||= b works in a way that:

  • if a is null, it assigns b to x
  • if a is falsy, it assigns b to x
  • otherwise, it assigns a to x.

In our setup, if the user set hermes_enabled to false in the Podfile (one of the suggested way to disabled Hermes), the options[:hermes_enabled] part will evaluate to false and, therefore, hermes_enabled will obtain the value of true.

Changelog

[iOS][Changed] - Use the correct operator to decide whether Hermes is enabled or not.

Differential Revision: D37643845

Summary:
The `||=` operator in an expression like `x = a ||= b` works in a way that:
- if a is null, it assigns b to x
- if a is `falsy`, it assigns b to x
- otherwise, it assigns a to x.

In our setup, if the user set `hermes_enabled` to `false` in the Podfile (one of the suggested way to disabled Hermes), the `options[:hermes_enabled]` part will evaluate to false and, therefore, `hermes_enabled` will obtain the value of `true`.

## Changelog

[iOS][Changed] - Use the correct operator to decide whether Hermes is enabled or not.

Differential Revision: D37643845

fbshipit-source-id: 0a1705ef107d45b4039cf50049f573823186d953
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Jul 6, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D37643845

@react-native-bot react-native-bot added the Platform: iOS iOS applications. label Jul 6, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,831,865 +0
android hermes armeabi-v7a 7,218,047 +0
android hermes x86 8,140,903 +0
android hermes x86_64 8,122,604 +0
android jsc arm64-v8a 9,696,772 +0
android jsc armeabi-v7a 8,452,020 +0
android jsc x86 9,647,512 +0
android jsc x86_64 10,245,289 +0

Base commit: 303aaf8
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 303aaf8
Branch: main

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @cipolleschi in 6148844.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner Platform: iOS iOS applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants