@@ -387,7 +387,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
387387 if ( atomicTypes . hasOwnProperty ( type ) ) return cont ( maybeop ) ;
388388 if ( type == "function" ) return cont ( functiondef , maybeop ) ;
389389 if ( type == "keyword c" || type == "async" ) return cont ( noComma ? maybeexpressionNoComma : maybeexpression ) ;
390- if ( type == "(" ) return cont ( pushlex ( ")" ) , maybeexpression , comprehension , expect ( ")" ) , poplex , maybeop ) ;
390+ if ( type == "(" ) return cont ( pushlex ( ")" ) , maybeexpression , expect ( ")" ) , poplex , maybeop ) ;
391391 if ( type == "operator" || type == "spread" ) return cont ( noComma ? expressionNoComma : expression ) ;
392392 if ( type == "[" ) return cont ( pushlex ( "]" ) , arrayLiteral , poplex , maybeop ) ;
393393 if ( type == "{" ) return contCommasep ( objprop , "}" , null , maybeop ) ;
@@ -641,16 +641,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
641641 }
642642 function arrayLiteral ( type ) {
643643 if ( type == "]" ) return cont ( ) ;
644- return pass ( expressionNoComma , maybeArrayComprehension ) ;
645- }
646- function maybeArrayComprehension ( type ) {
647- if ( type == "for" ) return pass ( comprehension , expect ( "]" ) ) ;
648- if ( type == "," ) return cont ( commasep ( maybeexpressionNoComma , "]" ) ) ;
649- return pass ( commasep ( expressionNoComma , "]" ) ) ;
650- }
651- function comprehension ( type ) {
652- if ( type == "for" ) return cont ( forspec , comprehension ) ;
653- if ( type == "if" ) return cont ( expression , comprehension ) ;
644+ return pass ( expressionNoComma , commasep ( expressionNoComma , "]" ) ) ;
654645 }
655646
656647 function isContinuedStatement ( state , textAfter ) {
0 commit comments