mirror of
https://github.com/github/codeql.git
synced 2026-01-07 03:30:24 +01:00
support top-level for await statements
This commit is contained in:
@@ -448,7 +448,11 @@ public class ESNextParser extends JSXParser {
|
||||
protected Statement parseForStatement(Position startLoc) {
|
||||
int startPos = this.start;
|
||||
boolean isAwait = false;
|
||||
if (this.inAsync && this.eatContextual("await")) isAwait = true;
|
||||
if (this.inAsync || (options.esnext() && !this.inFunction)) {
|
||||
if (this.eatContextual("await")) {
|
||||
isAwait = true;
|
||||
}
|
||||
}
|
||||
Statement forStmt = super.parseForStatement(startLoc);
|
||||
if (isAwait) {
|
||||
if (forStmt instanceof ForOfStatement) ((ForOfStatement) forStmt).setAwait(true);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class Main {
|
||||
* A version identifier that should be updated every time the extractor changes in such a way that
|
||||
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
|
||||
*/
|
||||
public static final String EXTRACTOR_VERSION = "2022-06-27";
|
||||
public static final String EXTRACTOR_VERSION = "2022-07-11";
|
||||
|
||||
public static final Pattern NEWLINE = Pattern.compile("\n");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user