patch up #1543 for harmony

fixes #1537
This commit is contained in:
kzc
2017-03-05 16:15:13 +08:00
committed by alexlamsl
parent 49d9ac1c43
commit 33a26d456b
2 changed files with 80 additions and 0 deletions

View File

@@ -1343,3 +1343,81 @@ issue_1537_for_of: {
for (k of {prop: 'val'});
}
}
issue_1537_destructuring_1: {
options = {
collapse_vars: true,
}
input: {
var x = 1, y = 2;
[x] = [y];
}
expect: {
var x = 1;
[x] = [2];
}
}
issue_1537_destructuring_2: {
options = {
collapse_vars: true,
}
input: {
var x = foo();
[x] = [1];
}
expect: {
var x = foo();
[x] = [1];
}
}
issue_1537_destructuring_3: {
options = {
collapse_vars: true,
}
input: {
var x = Math.random();
({p: x = 9} = {v: 1});
}
expect: {
var x = Math.random();
({p: x = 9} = {v: 1});
}
}
issue_1537_destructuring_for_in: {
options = {
collapse_vars: true,
}
input: {
var x = 1, y = 2;
(function() {
for ([[x], y] in a);
})();
}
expect: {
var x = 1, y = 2;
(function() {
for ([[x], y] in a);
})();
}
}
issue_1537_destructuring_for_of: {
options = {
collapse_vars: true,
}
input: {
var x = 1, y = 2;
(function() {
for ([[x], y] of a);
})();
}
expect: {
var x = 1, y = 2;
(function() {
for ([[x], y] of a);
})();
}
}