Skip to content

Commit

Permalink
Fix eager parsing of arrow functions for non-punc tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
viclm authored and rvanvelzen committed Mar 10, 2016
1 parent 0b30337 commit 6780d09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ function parse($TEXT, options) {
var maybe_assign = function(no_in) {
var start = S.token;

if (start.value == "(" && peek().value == ")") {
if (start.type == "punc" && start.value == "(" && peek().value == ")") {
next();
next();
return arrow_function([]);
Expand Down
8 changes: 8 additions & 0 deletions test/compress/issue-1001.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
parenthesis_strings_in_parenthesis: {
input: {
('(');
a(')');

}
expect_exact: '"(";a(")");'
}

0 comments on commit 6780d09

Please sign in to comment.