Repository navigation
fix(javascript): keep backtrace coordinates when source map lookup misses - #601
Merged
Merged
Conversation
…sses source-map-js returns nulls for an unmapped position, and writing them onto the frame dropped the catcher location.
Contributor
There was a problem hiding this comment.
🟢 Approved
There are no active review issues for the change preserving original backtrace frames when source-map lookups find no mapping.
No open issues 🎉
What changed in this PR
Preserves catcher-provided backtrace frames when source-map lookup finds no mapping, addressing #600 without overwriting the original location.
Changes:
- Returns the original frame when
originalLocation.sourceis missing. - Adds a regression test verifying that an unmapped position retains the original frame.
| File | Description |
|---|---|
workers/javascript/tests/index.test.ts |
Tests preservation of the original frame after a source-map lookup miss. |
workers/javascript/src/index.ts |
Adds an early return to prevent missing mappings from overwriting frame data. |
Review effort: Balanced
Kuchizu
added a commit
that referenced
this pull request
Nov 2, 2026
* fix(javascript): keep backtrace coordinates when source map lookup misses (#601) source-map-js returns nulls for an unmapped position, and writing them onto the frame dropped the catcher location. * Escape Markdown in Telegram notification titles (#599) * Escape Markdown in Telegram notification titles * Pin current date in paymaster tests to avoid month overflow * Escape project name in Telegram notification footer --------- Co-authored-by: Peter <specc.dev@gmail.com> --------- Co-authored-by: Peter <specc.dev@gmail.com> Co-authored-by: Kuchizu <70284260+Kuchizu@users.noreply.github.com>
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.
Summary
originalPositionFordoes not find a generated position,source-map-jsreturns nulls. Those nulls were written onto the frame andsourceCodebecame[], so the catcher location was lost.originalLocation.sourceis missing,consumeBacktraceFramenow returns the original frame.Fixes #600
Test plan
yarn jest workers/javascript/tests/index.test.ts -t "should keep the original frame|should parse source maps correctly"originalPositionForstill shows the original file, line, and column