Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions javascript/extractor/src/com/semmle/jcorn/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -2296,9 +2296,9 @@ protected Identifier parseIdent(boolean liberal) {
&& (this.options.ecmaVersion() >= 6
|| inputSubstring(this.start, this.end).indexOf("\\") == -1))
this.raiseRecoverable(this.start, "The keyword '" + this.value + "' is reserved");
if (!isPrivateField && this.inGenerator && this.value.equals("yield"))
if (!liberal && !isPrivateField && this.inGenerator && this.value.equals("yield"))
this.raiseRecoverable(this.start, "Can not use 'yield' as identifier inside a generator");
if (!isPrivateField && this.inAsync && this.value.equals("await"))
if (!liberal && !isPrivateField && this.inAsync && this.value.equals("await"))
this.raiseRecoverable(
this.start, "Can not use 'await' as identifier inside an async function");
name = String.valueOf(this.value);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import javascript

from Expr e
where e.toString() = "this expression should not exist"
select e
Comment on lines +3 to +5
5 changes: 5 additions & 0 deletions javascript/ql/test/library-tests/AwaitPropertyName/tst.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const pool = { await() { return 42; } };

async function issue22499() {
return await pool.await();
}
Loading