forked from facebook/metro
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: **Summary** All React Native JavaScript runtimes, as well as Node, implement `Object.assign()`. This PR removes the transform and configures plugins to use `Object.assign` instead of injecting the Babel helper `_extends()`. This simplifies the generated code, and it aligns JavaScriptCore users more closely with Hermes, which doesn't use several of the plugins. The following plugins generate code using `Object.assign` directly: - `transform-destructuring` - `proposal-object-rest-spread` - `transform-react-jsx` **Test plan** I added a unit test to verify the new behavior. The Babel `_extends` helper already uses Object.assign if it exists, so the runtime behavior will be identical. ``` _extends = Object.assign || function (target) { ... } ``` Pull Request resolved: facebook#745 Reviewed By: motiz88 Differential Revision: D34074342 Pulled By: rh389 fbshipit-source-id: dc416d9b40877da49f6966c5c6708b99fa0ce492
- Loading branch information
1 parent
9f77c78
commit a1ca24c
Showing
5 changed files
with
95 additions
and
52 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
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