@@ -355,6 +355,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
355355 if ( type == "operator" || type == "spread" ) return cont ( noComma ? expressionNoComma : expression ) ;
356356 if ( type == "[" ) return cont ( pushlex ( "]" ) , arrayLiteral , poplex , maybeop ) ;
357357 if ( type == "{" ) return contCommasep ( objprop , "}" , null , maybeop ) ;
358+ if ( type == "quasi" ) { return pass ( quasi , maybeop ) ; }
358359 return cont ( ) ;
359360 }
360361 function maybeexpression ( type ) {
@@ -379,21 +380,22 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
379380 if ( value == "?" ) return cont ( expression , expect ( ":" ) , expr ) ;
380381 return cont ( expr ) ;
381382 }
382- if ( type == "quasi" ) { cx . cc . push ( me ) ; return quasi ( value ) ; }
383+ if ( type == "quasi" ) { return pass ( quasi , me ) ; }
383384 if ( type == ";" ) return ;
384385 if ( type == "(" ) return contCommasep ( expressionNoComma , ")" , "call" , me ) ;
385386 if ( type == "." ) return cont ( property , me ) ;
386387 if ( type == "[" ) return cont ( pushlex ( "]" ) , maybeexpression , expect ( "]" ) , poplex , me ) ;
387388 }
388- function quasi ( value ) {
389- if ( value . slice ( value . length - 2 ) != "${" ) return cont ( ) ;
389+ function quasi ( type , value ) {
390+ if ( type != "quasi" ) return pass ( ) ;
391+ if ( value . slice ( value . length - 2 ) != "${" ) return cont ( quasi ) ;
390392 return cont ( expression , continueQuasi ) ;
391393 }
392394 function continueQuasi ( type ) {
393395 if ( type == "}" ) {
394396 cx . marked = "string-2" ;
395397 cx . state . tokenize = tokenQuasi ;
396- return cont ( ) ;
398+ return cont ( quasi ) ;
397399 }
398400 }
399401 function arrowBody ( type ) {
0 commit comments