Fix nested object spread (#4974)
This commit is contained in:
parent
608e77e389
commit
88bc28c414
@ -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;
|
||||
|
||||
@ -1 +1,3 @@
|
||||
z = { x, ...y };
|
||||
|
||||
z = { x, w: { ...y } };
|
||||
|
||||
@ -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 } });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user