| Index: compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| diff --git a/compiler/java/com/google/dart/compiler/parser/DartParser.java b/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| index fac4bcb200b3bd2f4ffec35cb570e9ab9b6dba8e..ada0732f31d29d6d2455ac4d5ca395a44027ef5b 100644
|
| --- a/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| +++ b/compiler/java/com/google/dart/compiler/parser/DartParser.java
|
| @@ -4369,6 +4369,13 @@ public class DartParser extends CompletionHooksParserBase {
|
| if (!optional(Token.LPAREN)) {
|
| return false;
|
| }
|
| + // if it looks as "(Type name, ....)" then it may be function expression
|
| + boolean hasTwoIdentifiersComma;
|
| + {
|
| + int nameOffset = skipTypeName(0);
|
| + hasTwoIdentifiersComma = nameOffset != -1 && peek(nameOffset + 0) == Token.IDENTIFIER
|
| + && peek(nameOffset + 1) == Token.COMMA;
|
| + }
|
| // find matching parenthesis
|
| int count = 1;
|
| while (count != 0) {
|
| @@ -4383,7 +4390,7 @@ public class DartParser extends CompletionHooksParserBase {
|
| break;
|
| }
|
| }
|
| - return (peek(0) == Token.ARROW || peek(0) == Token.LBRACE);
|
| + return (peek(0) == Token.ARROW || peek(0) == Token.LBRACE) || hasTwoIdentifiersComma;
|
| } finally {
|
| rollback();
|
| }
|
|
|