Fix nested object spread (#4974)

This commit is contained in:
Henry Zhu 2016-12-08 19:30:50 -05:00 committed by GitHub
parent 608e77e389
commit 88bc28c414
3 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,7 @@ export default function ({ types: t }) {
path.traverse({
RestProperty() {
foundRestProperty = true;
path.stop();
}
});
return foundRestProperty;
@ -14,6 +15,7 @@ export default function ({ types: t }) {
path.traverse({
SpreadProperty() {
foundSpreadProperty = true;
path.stop();
}
});
return foundSpreadProperty;

View File

@ -1 +1,3 @@
z = { x, ...y };
z = { x, w: { ...y } };

View File

@ -1,3 +1,5 @@
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
z = _extends({ x }, y);
z = _extends({ x, w: { ...y } });