I want the JSParser to accept the await keyword in the editor

I want the script editor to accept the await keyword. Where can I set that this is allowed. At the moment the editor shows that the await is not supported at top level, unless the module option is set to ‘es2022’ …

Where can I set this?

In order to support await keyword in JSParser you can implement JSParserEx like this

 public class JsParserEx : JsParser
 {
     protected override void InitReswords()
     {
         base.InitReswords();
         reswords.Add("await", CsLexerToken.Await);
     }
 }
1 Like