JavaScript: Allow first expression in array literal to be an in expression.

This commit is contained in:
Max Schaefer
2019-02-27 08:53:01 +00:00
parent 46a1c75549
commit 6ecdb0edd5
4 changed files with 106 additions and 2 deletions

View File

@@ -147,7 +147,7 @@ public class CustomParser extends FlowParser {
this.type == TokenType.ellipsis) {
elements = this.parseExprList(TokenType.bracketR, true, true, refDestructuringErrors);
} else {
Expression firstExpr = this.parseMaybeAssign(true, refDestructuringErrors, null);
Expression firstExpr = this.parseMaybeAssign(false, refDestructuringErrors, null);
// check whether this is a postfix array comprehension
if (this.type == TokenType._for || this.type == TokenType._if) {
ComprehensionExpression c = this.parseComprehension(startLoc, false, firstExpr);

View File

@@ -41,7 +41,7 @@ public class Main {
* such a way that it may produce different tuples for the same file under the same
* {@link ExtractorConfig}.
*/
public static final String EXTRACTOR_VERSION = "2019-02-04";
public static final String EXTRACTOR_VERSION = "2019-02-27";
public static final Pattern NEWLINE = Pattern.compile("\n");