src: fix crash in GetErrorSource() for invalid using syntax#62770
Open
semimikoh wants to merge 1 commit intonodejs:mainfrom
Open
src: fix crash in GetErrorSource() for invalid using syntax#62770semimikoh wants to merge 1 commit intonodejs:mainfrom
semimikoh wants to merge 1 commit intonodejs:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #62770 +/- ##
==========================================
- Coverage 91.55% 89.69% -1.86%
==========================================
Files 355 706 +351
Lines 149381 218127 +68746
Branches 23364 41738 +18374
==========================================
+ Hits 136765 195652 +58887
- Misses 12354 14397 +2043
- Partials 262 8078 +7816
🚀 New features to boost your workflow:
|
aduh95
reviewed
Apr 16, 2026
Comment on lines
+10
to
+11
| 'async function f() { { await using x=null, []=null; } }', | ||
| 'async function f() { { await using x=null, {}=null; } }', |
Contributor
There was a problem hiding this comment.
Suggested change
| 'async function f() { { await using x=null, []=null; } }', | |
| 'async function f() { { await using x=null, {}=null; } }', | |
| 'async function f() { await using x=null, []=null; }', | |
| 'async function f() { await using x=null, {}=null; }', |
or even
Suggested change
| 'async function f() { { await using x=null, []=null; } }', | |
| 'async function f() { { await using x=null, {}=null; } }', | |
| '{ await using x=null, []=null; }', | |
| '{ await using x=null, {}=null; }', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #62767
V8 can report an invalid source range for some malformed
usingandawait usingdeclarations, with the end column preceding the startcolumn.
GetErrorSource()currently asserts that the end column isgreater than or equal to the start column before reaching the existing
bounds check, so formatting the SyntaxError aborts the process.
Remove the assertion and only apply the script start offset when both
columns can be adjusted. Invalid ranges now fall through to the existing
fallback path, which prints the error source without an underline instead
of crashing.
Add regression coverage for the four invalid
using/await usingcases reported from test262.
Refs: https://github.com/tc39/test262
Verification