File tree Expand file tree Collapse file tree
ql/test/library-tests/AwaitPropertyName Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2296,9 +2296,9 @@ protected Identifier parseIdent(boolean liberal) {
22962296 && (this .options .ecmaVersion () >= 6
22972297 || inputSubstring (this .start , this .end ).indexOf ("\\ " ) == -1 ))
22982298 this .raiseRecoverable (this .start , "The keyword '" + this .value + "' is reserved" );
2299- if (!isPrivateField && this .inGenerator && this .value .equals ("yield" ))
2299+ if (!liberal && ! isPrivateField && this .inGenerator && this .value .equals ("yield" ))
23002300 this .raiseRecoverable (this .start , "Can not use 'yield' as identifier inside a generator" );
2301- if (!isPrivateField && this .inAsync && this .value .equals ("await" ))
2301+ if (!liberal && ! isPrivateField && this .inAsync && this .value .equals ("await" ))
23022302 this .raiseRecoverable (
23032303 this .start , "Can not use 'await' as identifier inside an async function" );
23042304 name = String .valueOf (this .value );
Original file line number Diff line number Diff line change 1+ import javascript
2+
3+ from JSParseError err
4+ select err
Original file line number Diff line number Diff line change 1+ semmle-extractor-options: --tolerate-parse-errors
Original file line number Diff line number Diff line change 1+ const pool = { await ( ) { return 42 ; } } ;
2+ const generator = { yield ( ) { return 42 ; } } ;
3+
4+ async function issue22499 ( ) {
5+ return await pool . await ( ) ;
6+ }
7+
8+ function * yieldPropertyName ( ) {
9+ return generator . yield ( ) ;
10+ }
You can’t perform that action at this time.
0 commit comments