Update test262 suite to latest and fix using/await using issues#31
Update test262 suite to latest and fix using/await using issues#31adams85 merged 8 commits intoadams85:masterfrom
Conversation
…AsLhs option Fix IsUsingKeyword to correctly handle 'of' as a variable name in for-loops: - `for (using of = null;;)` - regular for-loop with variable named 'of' - `for (using of of [])` - for-of loop with binding named 'of' - `for (await using of of [])` - await-using with binding named 'of' Add opt-in AllowCallExpressionAsLhs parser option for AnnexB B.3.7 support: - When enabled in non-strict mode, CallExpression is allowed as LHS in assignments, compound assignments, update expressions, and for-in/of loops - The runtime should throw ReferenceError instead of parser throwing SyntaxError Update test262 suite SHA and allow-list. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…exts Per the explicit-resource-management spec: - using/await using declarations in for-in loops are invalid syntax - using/await using declarations are not allowed as the sole statement in if/while/do/for bodies or labeled statements (non-block contexts) This fixes 18 test262 test cases (9 files x 2 modes). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… assignments - Enable AllowCallExpressionAsLhs in both Program.cs and Test262Test.cs runners - Distinguish logical assignments (&&=, ||=, ??=) from regular/compound assignments: AnnexB B.3.7 only applies to =, +=, etc., not logical assignments which require 'simple' assignment target per spec - Add LogicalAssignment to LeftHandSideKind enum - Remove 7 callexpression entries from allow-list (all now pass) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous value of 855 overflowed when running in the full test suite on net10.0 (stack partially consumed by preceding tests). 845 is near the limit while leaving enough margin for the full suite context. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Thank you for submitting these corrections. I'll need some time to review them thoroughly, but I have some preliminary remarks:
|
|
Thank you for the feedback these were issues that were somewhat blocking Jint's test suite, but not a pressing concern or anything. Feel free to adjust and throw away things (or create a separate change set that you feel comfortable with). |
|
FYI, I made some corrections to the using/await using fix (see the updated PR description) and merged #32 into this PR. I plan to merge and release it soon. I also extracted the AnnexB B.3.9 stuff into a separate a PR, which I'm going to leave as a draft for now, until I make up my mind what to do with it. Is this okay with you? |
I'm happy if I'm of any help, even with the AI tooling. Feel free to do whatever you feel is best, it's your codebase, I'm not looking for attribution either. This pushes Jint forward so that's just my selfish goal 👍 |
|
These bugfixes are tremendously useful, keep 'em coming! 👍 In general, draft/experimental features are welcome too, but those may be put on hold as I want to keep the project as close to upstream as possible to avoid extra work and ensure maintainability in the long run. So, in the case of features, it's best to have a discussion beforehand to find out whether the time is ripe. |
|
@lahma FYI, I backported the |
|
Thank you for the update, Jint has integrated the version ( sebastienros/jint#2374 ) and again we got rid of more exclusions 🥳 |
Summary
IsUsingKeywordto correctly handleofas a variable name in for-loops withusing/await usingdeclarationsAdd opt-inAllowCallExpressionAsLhsparser option for AnnexB B.3.9 (Runtime Errors for Function Call Assignment Targets)IsUsingKeyword fix
The
isFor && id is "of"check was too aggressive — it rejectedofas a binding name without looking ahead. Now disambiguates:for (using of = null;;)ofis variable namefor (using of of [])ofis binding namefor (await using of of [])ofis binding namefor (using of <expr>)usingis expressionAllowCallExpressionAsLhsPer AnnexB B.3.7, in non-strict modef() = g()should parse successfully and throwReferenceErrorat runtime (notSyntaxErrorat parse time). The new option (defaults tofalse) allowsCallExpressionas LHS in:Simple and compound assignmentsPrefix/postfix update expressionsFor-in/for-of loop left-hand sideTest plan
🤖 Generated with Claude Code
UPDATE
The IsUsingKeyword fix has been corrected as it didn't handle some edge cases (e.g.
for (using of == null;;)orfor (using ofx of []), etc.)The AnnexB B.3.9 stuff has been extracted to a separate PR (#33).