object rest - fix when destructuring in variables/parameters (#4755)
* object rest - fix when destructuring in variables/parameters * fixes + ExportNamedDeclaration support * Account for CatchClause * support ForXStatement * support assignment expression? + PR fixes
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
var z = {};
|
||||
var { ...x } = z;
|
||||
var { ...a } = { a: 1 };
|
||||
var { ...x } = a.b;
|
||||
var { ...x } = a();
|
||||
var {x1, ...y1} = z;
|
||||
x1++;
|
||||
var { [a]: b, ...c } = z;
|
||||
var {x1, ...y1} = z;
|
||||
let {x2, y2, ...z2} = z;
|
||||
const {w3, x3, y3, ...z4} = z;
|
||||
|
||||
let {
|
||||
x: { a: xa, [d]: f, ...asdf },
|
||||
y: { ...d },
|
||||
...g
|
||||
} = complex;
|
||||
@@ -0,0 +1,24 @@
|
||||
var z = {};
|
||||
var x = babelHelpers.objectWithoutProperties(z, []);
|
||||
var a = babelHelpers.objectWithoutProperties({ a: 1 }, []);
|
||||
var x = babelHelpers.objectWithoutProperties(a.b, []);
|
||||
var x = babelHelpers.objectWithoutProperties(a(), []);
|
||||
|
||||
var { x1 } = z;
|
||||
var y1 = babelHelpers.objectWithoutProperties(z, ["x1"]);
|
||||
x1++;
|
||||
var { [a]: b } = z;
|
||||
var c = babelHelpers.objectWithoutProperties(z, [a]);
|
||||
var { x1 } = z;
|
||||
var y1 = babelHelpers.objectWithoutProperties(z, ["x1"]);
|
||||
let { x2, y2 } = z;
|
||||
let z2 = babelHelpers.objectWithoutProperties(z, ["x2", "y2"]);
|
||||
const { w3, x3, y3 } = z;
|
||||
|
||||
const z4 = babelHelpers.objectWithoutProperties(z, ["w3", "x3", "y3"]);
|
||||
let {
|
||||
x: { a: xa, [d]: f }
|
||||
} = complex;
|
||||
let asdf = babelHelpers.objectWithoutProperties(complex.x, ["a", d]),
|
||||
d = babelHelpers.objectWithoutProperties(complex.y, []),
|
||||
g = babelHelpers.objectWithoutProperties(complex, ["x"]);
|
||||
Reference in New Issue
Block a user