forked from babel/babel
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix destructuring rest with template literal (babel#10013)
* fix destructuring rest with template literal * update test
- Loading branch information
1 parent
2eee395
commit 343c2bb
Showing
3 changed files
with
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
const input = {}; | ||
|
||
const { | ||
given_name: givenName, | ||
'last_name': lastName, | ||
[`country`]: country, | ||
[prefix + 'state']: state, | ||
[`${prefix}consents`]: consents, | ||
...rest | ||
} = input; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var input = {}; | ||
|
||
var _ref = prefix + 'state', | ||
_ref2 = `${prefix}consents`, | ||
givenName = input.given_name, | ||
lastName = input['last_name'], | ||
country = input[`country`], | ||
state = input[_ref], | ||
consents = input[_ref2], | ||
rest = babelHelpers.objectWithoutProperties(input, ["given_name", "last_name", `country`, _ref, _ref2].map(babelHelpers.toPropertyKey)); |