add destructuring support
This commit is contained in:
1
test/fixtures/destructuring/array/actual.js
vendored
Normal file
1
test/fixtures/destructuring/array/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var [a, [b], [c], d] = ["hello", [", ", "junk"], ["world"]];
|
||||
5
test/fixtures/destructuring/array/expected.js
vendored
Normal file
5
test/fixtures/destructuring/array/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
var _ref = ["hello", [", ", "junk"], ["world"]];
|
||||
var a = _ref[0];
|
||||
var b = _ref[1][0];
|
||||
var c = _ref[2][0];
|
||||
var d = _ref[3];
|
||||
1
test/fixtures/destructuring/mixed/actual.js
vendored
Normal file
1
test/fixtures/destructuring/mixed/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var {topLeft: [x1, y1], bottomRight: [x2, y2] } = rect;
|
||||
4
test/fixtures/destructuring/mixed/expected.js
vendored
Normal file
4
test/fixtures/destructuring/mixed/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var x1 = rect.topLeft[0];
|
||||
var y1 = rect.topLeft[1];
|
||||
var x2 = rect.bottomRight[0];
|
||||
var y2 = rect.bottomRight[1];
|
||||
1
test/fixtures/destructuring/multiple/actual.js
vendored
Normal file
1
test/fixtures/destructuring/multiple/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var { x, y } = coords, foo = "bar";
|
||||
3
test/fixtures/destructuring/multiple/expected.js
vendored
Normal file
3
test/fixtures/destructuring/multiple/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var x = coords.x;
|
||||
var y = coords.y;
|
||||
var foo = "bar";
|
||||
1
test/fixtures/destructuring/object-advanced/actual.js
vendored
Normal file
1
test/fixtures/destructuring/object-advanced/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var {topLeft: {x: x1, y: y1}, bottomRight: {x: x2, y: y2}} = rect;
|
||||
4
test/fixtures/destructuring/object-advanced/expected.js
vendored
Normal file
4
test/fixtures/destructuring/object-advanced/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
var x1 = rect.topLeft.x;
|
||||
var y1 = rect.topLeft.y;
|
||||
var x2 = rect.bottomRight.x;
|
||||
var y2 = rect.bottomRight.y;
|
||||
1
test/fixtures/destructuring/object-basic/actual.js
vendored
Normal file
1
test/fixtures/destructuring/object-basic/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
var { x, y } = coords;
|
||||
2
test/fixtures/destructuring/object-basic/expected.js
vendored
Normal file
2
test/fixtures/destructuring/object-basic/expected.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
var x = coords.x;
|
||||
var y = coords.y;
|
||||
Reference in New Issue
Block a user