unwind IIFE class patterns (#3373)

fixes #2332
This commit is contained in:
Alex Lam S.L
2019-04-21 09:49:07 +08:00
committed by GitHub
parent 338dd144b8
commit f01cc1e413
3 changed files with 80 additions and 25 deletions

View File

@@ -6157,3 +6157,24 @@ sub_property: {
}
expect_stdout: "PASS"
}
assign_undeclared: {
options = {
collapse_vars: true,
toplevel: true,
unused: true,
}
input: {
var A = (console.log(42), function() {});
B = new A();
console.log(typeof B);
}
expect: {
B = new (console.log(42), function() {})();
console.log(typeof B);
}
expect_stdout: [
"42",
"object",
]
}