@@ -41,7 +41,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
41
41
"true" : atom , "false" : atom , "null" : atom , "undefined" : atom , "NaN" : atom , "Infinity" : atom ,
42
42
"this" : kw ( "this" ) , "class" : kw ( "class" ) , "super" : kw ( "atom" ) ,
43
43
"yield" : C , "export" : kw ( "export" ) , "import" : kw ( "import" ) , "extends" : C ,
44
- "await" : C , "async" : kw ( "async" )
44
+ "await" : C
45
45
} ;
46
46
47
47
// Extend the 'normal' keywords with the TypeScript language extensions
@@ -147,9 +147,16 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) {
147
147
return ret ( "operator" , "operator" , stream . current ( ) ) ;
148
148
} else if ( wordRE . test ( ch ) ) {
149
149
stream . eatWhile ( wordRE ) ;
150
- var word = stream . current ( ) , known = keywords . propertyIsEnumerable ( word ) && keywords [ word ] ;
151
- return ( known && state . lastType != "." ) ? ret ( known . type , known . style , word ) :
152
- ret ( "variable" , "variable" , word ) ;
150
+ var word = stream . current ( )
151
+ if ( state . lastType != "." ) {
152
+ if ( keywords . propertyIsEnumerable ( word ) ) {
153
+ var kw = keywords [ word ]
154
+ return ret ( kw . type , kw . style , word )
155
+ }
156
+ if ( word == "async" && stream . match ( / ^ \s * [ \( \w ] / , false ) )
157
+ return ret ( "async" , "keyword" , word )
158
+ }
159
+ return ret ( "variable" , "variable" , word )
153
160
}
154
161
}
155
162
0 commit comments