Assign another temp var when parsing assignment patterns in destructuring (#7333)

This commit is contained in:
Brian Ng
2018-03-09 02:39:25 -06:00
committed by Nicolò Ribaudo
parent 4da3f3bc64
commit 4f4dd3d4a6
5 changed files with 35 additions and 24 deletions

View File

@@ -0,0 +1,5 @@
const getState = () => ({});
const { data: { courses: oldCourses = [] } = {} } = getState();
assert.deepEqual(oldCourses, []);

View File

@@ -0,0 +1 @@
const { data: { courses: oldCourses = [] } = {} } = getState();

View File

@@ -0,0 +1,3 @@
{
"plugins": ["transform-destructuring"]
}

View File

@@ -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;