-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
renameTo
not taking property shorthands into account (#211)
* Fix `renameTo` not taking property shorthands into account This fixes the `renameTo` helper method not properly renaming object properties that are shorthands. The previous version of the code would rename the property's `value` correctly, but since `shorthand` was still set as `true`, the output result would still be the old variable as a shorthand property. Now, if an identifier to be renamed is of type `Property` and is a shorthand (but not a method), we flip the `shorthand` value to be `false`. * babel -> getParser() * Add comment that explains why this works
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 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