improve parenthesis emission (#2196)

- eliminate `throw` usages
- suppress extraneous parenthesis
  - `new function() {foo.bar()}.baz`
  - `for (function() { "foo" in bar; };;);`
This commit is contained in:
Alex Lam S.L
2017-07-03 04:17:37 +08:00
committed by GitHub
parent 6b3aeff1d8
commit af0262b7e5
5 changed files with 60 additions and 22 deletions

View File

@@ -436,3 +436,17 @@ do_switch: {
} while (false);
}
}
in_parenthesis_1: {
input: {
for (("foo" in {});0;);
}
expect_exact: 'for(("foo"in{});0;);'
}
in_parenthesis_2: {
input: {
for ((function(){ "foo" in {}; });0;);
}
expect_exact: 'for(function(){"foo"in{}};0;);'
}