Allow JavaScript property named await in async functions - #9
anurag6569201 wants to merge 1 commit into
Conversation
Source PR: github#22500 Source head: 365727c
✅ Shipwright · ApproveRecommendation: approve PR #9 · Tier
Findings (3)
Fireworks usage: 6,310 input · 365 output · 6,675 total tokens · $0.0016 · 8s · 0 fix iteration(s) Open the Shipwright check for full evidence and the audit bundle. Use |
| @@ -0,0 +1,4 @@ | |||
| import javascript | |||
|
|
|||
| from JSParseError err | |||
There was a problem hiding this comment.
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.
| || 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")) |
There was a problem hiding this comment.
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.
CodeQL reported a JavaScript parse error for valid property access expressions named
awaitinside async functions. This affected code such as:Parser
await/yieldidentifier restrictions for ordinary identifiers.Regression coverage
.awaitproperty access inside an async function.DCA verifies that this change resolves somes spurious syntax errors.
Source merge-base:
b5d570f106197f58168d1e57c952d065571fff17Source head:
365727c445c8f0d60e078809a590c84279ac1e7e