fix unsafe join() on array literal with spread (#2347)

fixes #2345
This commit is contained in:
kzc
2017-10-05 12:57:00 -04:00
committed by Alex Lam S.L
parent 873755b35c
commit 336b1add4f
2 changed files with 28 additions and 2 deletions

View File

@@ -839,3 +839,27 @@ class_name_can_be_preserved_with_reserved: {
}
}
}
issue_2345: {
options = {
evaluate: true,
side_effects: true,
unsafe: true,
unused: true,
}
input: {
console.log([...[3, 2, 1]].join("-"));
var a = [3, 2, 1];
console.log([...a].join("-"));
}
expect: {
console.log([...[3, 2, 1]].join("-"));
var a = [3, 2, 1];
console.log([...a].join("-"));
}
expect_stdout: [
"3-2-1",
"3-2-1",
]
node_version: ">=6"
}