Skip to content

feat: Support for parsing scopes - #142

Merged
loewenheim merged 14 commits into
masterfrom
sebastian/scopes
Nov 26, 2026
Merged

loewenheim merged 14 commits into
masterfrom
sebastian/scopes

Conversation

@loewenheim

@loewenheim loewenheim commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

This implements part of https://tc39.es/ecma426/branch/proposal-scopes/. It only handles parsing scopes and returning them for sourcemaps, but doesn't handle:

  • serializing scopes back
  • variables in scopes
  • ranges in any way

Also, I don't have any real tests yet because I don't have a sourcemap with scope information available.

ref: #140. ref: RUSTSM-18.

@loewenheim
loewenheim requested a review from a team November 25, 2026 14:10
@loewenheim
loewenheim marked this pull request as ready for review November 25, 2026 14:10

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 58b51a9. Configure here.

Comment thread src/decoder/scope.rs Resolved
Comment thread src/decoder/scope.rs Resolved
Comment thread src/jsontypes.rs Resolved
Comment thread src/types/mod.rs Resolved
@linear-code

linear-code Bot commented Nov 25, 2026

Copy link
Copy Markdown

RUSTSM-18

Comment thread src/decoder/scope.rs Resolved
@loewenheim
loewenheim merged commit f80828d into master Nov 26, 2026
15 checks passed
@loewenheim
loewenheim deleted the sebastian/scopes branch November 26, 2026 10:19
kdy1 added a commit to swc-project/swc-sourcemap that referenced this pull request Nov 27, 2026
## Summary

Merge upstream `getsentry/rust-sourcemap` `master` (head `499ada5`) into
the fork. The merge uses a merge commit.

Merged upstream commits:

- `f80828d` feat: Support for parsing scopes (getsentry#142)
- `499ada5` fix: Also fix VLQ bug during encoding (getsentry#144)

## Conflict resolution

- `src/types/mod.rs`: The fork's `Cow` and `BytesStr` changes stay. The
upstream `BTreeMap` import and `scopes` field are added. The upstream
removal of `#[allow(clippy::ptr_arg)]` on `create_ranges` is applied.
- `src/types/scope.rs`: `OriginalScope::get_name` and
`OriginalScope::get_kind` now return `Option<&BytesStr>`. This matches
the fork's `SourceMap::get_name` API.

## Validation

Local checks on the merge commit: `cargo build --all-targets` and `cargo
test --all-features` pass. `cargo fmt --check` passes after formatting.
`cargo clippy` is not installed for the local toolchain, so it did not
run. CI has not run yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants