-
Notifications
You must be signed in to change notification settings - Fork 0
Allow JavaScript property named await in async functions #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: qa/agent-github-codeql/pr-09-22500/base
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| import javascript | ||
|
|
||
| from JSParseError err | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shipwright · HIGH The test only asserts that some JSParseError exists (select err), but the expected file is empty. Impact: The test only asserts that some JSParseError exists (select err), but the expected file is empty. This means the test passes vacuously: it does not verify that the specific await/yield property-name cases parse without error, nor that unrelated parse errors are absent. A regression that makes the entire file fail to parse would still satisfy this query. Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright. |
||
| select err | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| semmle-extractor-options: --tolerate-parse-errors |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| const pool = { await() { return 42; } }; | ||
| const generator = { yield() { return 42; } }; | ||
|
|
||
| async function issue22499() { | ||
| return await pool.await(); | ||
| } | ||
|
|
||
| function* yieldPropertyName() { | ||
| return generator.yield(); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shipwright · HIGH
The change to parseIdent now suppresses the 'yield'/'await' identifier errors whenever liberal is true, not just for private fields.
Impact: The change to parseIdent now suppresses the 'yield'/'await' identifier errors whenever liberal is true, not just for private fields. The liberal flag is used in contexts beyond property names (e.g., error recovery, certain parsing modes), so this could silently accept invalid generator/async code that previously raised recoverable errors, changing downstream AST/error behavior for existing queries.
Suggested fix: Review the cited evidence, fix the risk if confirmed, and rerun Shipwright.