forked from babel/babel
-
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.
Assign another temp var when parsing assignment patterns in destructu…
…ring (babel#7333)
- Loading branch information
1 parent
4da3f3b
commit 4f4dd3d
Showing
5 changed files
with
35 additions
and
24 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
5 changes: 5 additions & 0 deletions
5
packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/exec.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,5 @@ | ||
const getState = () => ({}); | ||
|
||
const { data: { courses: oldCourses = [] } = {} } = getState(); | ||
|
||
assert.deepEqual(oldCourses, []); |
1 change: 1 addition & 0 deletions
1
packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/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 @@ | ||
const { data: { courses: oldCourses = [] } = {} } = getState(); |
3 changes: 3 additions & 0 deletions
3
packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/options.json
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,3 @@ | ||
{ | ||
"plugins": ["transform-destructuring"] | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/babel-plugin-transform-destructuring/test/fixtures/destructuring/const/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,5 @@ | ||
const _getState = getState(), | ||
_getState$data = _getState.data, | ||
_getState$data2 = _getState$data === void 0 ? {} : _getState$data, | ||
_getState$data2$cours = _getState$data2.courses, | ||
oldCourses = _getState$data2$cours === void 0 ? [] : _getState$data2$cours; |