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 (#10013)
* fix destructuring rest with template literal * update test
- Loading branch information
1 parent
a6392bd
commit b6486a2
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
10 changes: 10 additions & 0 deletions
10
...ages/babel-plugin-transform-destructuring/test/fixtures/destructuring/issue-9834/input.js
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; |
10 changes: 10 additions & 0 deletions
10
...ges/babel-plugin-transform-destructuring/test/fixtures/destructuring/issue-9834/output.js
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)); |