support destructuring in AssignmentStatement and ForOf loops
This commit is contained in:
1
test/fixtures/destructuring/assignment/actual.js
vendored
Normal file
1
test/fixtures/destructuring/assignment/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
[a, b] = f();
|
||||
3
test/fixtures/destructuring/assignment/expected.js
vendored
Normal file
3
test/fixtures/destructuring/assignment/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
var _ref = f();
|
||||
a = _ref[0];
|
||||
b = _ref[1];
|
||||
3
test/fixtures/destructuring/for-in/actual.js
vendored
Normal file
3
test/fixtures/destructuring/for-in/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
for (var [name, value] in obj) {
|
||||
print("Name: " + name + ", Value: " + value);
|
||||
}
|
||||
4
test/fixtures/destructuring/for-in/expected.js
vendored
Normal file
4
test/fixtures/destructuring/for-in/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
for (var name in obj) {
|
||||
var value = obj[name];
|
||||
print("Name: " + name + ", Value: " + value);
|
||||
}
|
||||
3
test/fixtures/destructuring/for-of/actual.js
vendored
Normal file
3
test/fixtures/destructuring/for-of/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
for (var [ name, before, after ] of this.test.expectation.registers) {
|
||||
|
||||
}
|
||||
5
test/fixtures/destructuring/for-of/expected.js
vendored
Normal file
5
test/fixtures/destructuring/for-of/expected.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
for (var _iterator = this.test.expectation.registers[Symbol.iterator](), _step; !(_step = _iterator.next()).done;) {
|
||||
var name = _step.value[0];
|
||||
var before = _step.value[1];
|
||||
var after = _step.value[2];
|
||||
}
|
||||
Reference in New Issue
Block a user