Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 73 additions & 88 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ repository = "https://github.com/getsentry/js-source-scopes"
[dependencies]
indexmap = "2.8.0"
sourcemap = "9.1.2"
swc_common = "8.0.0"
swc_ecma_parser = "10.0.1"
swc_ecma_visit = { version = "8.0.0", features = ["path"] }
swc_common = "17.0.1"
swc_ecma_parser = "27.0.7"
swc_ecma_visit = { version = "18.0.1", features = ["path"] }
thiserror = "2.0.12"
tracing = "0.1.36"
6 changes: 3 additions & 3 deletions src/scope_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl ScopeIndex {
}

/// Looks up the scope corresponding to the given `offset`.
pub fn lookup(&self, offset: u32) -> ScopeLookupResult {
pub fn lookup(&self, offset: u32) -> ScopeLookupResult<'_> {
let range_idx = match self.ranges.binary_search_by_key(&offset, |r| r.0) {
Ok(idx) => idx,
Err(0) => 0, // this is pretty much unreachable since the first offset is 0
Expand All @@ -99,7 +99,7 @@ impl ScopeIndex {
self.resolve_name(name_idx)
}

fn resolve_name(&self, name_idx: u32) -> ScopeLookupResult {
fn resolve_name(&self, name_idx: u32) -> ScopeLookupResult<'_> {
if name_idx == GLOBAL_SCOPE_SENTINEL {
ScopeLookupResult::Unknown
} else if name_idx == ANONYMOUS_SCOPE_SENTINEL {
Expand All @@ -116,7 +116,7 @@ impl ScopeIndex {
/// offsets.
///
/// Scopes are returned in order of their starting offsets.
pub fn iter(&self) -> impl Iterator<Item = (u32, ScopeLookupResult)> {
pub fn iter(&self) -> impl Iterator<Item = (u32, ScopeLookupResult<'_>)> {
self.ranges.iter().map(|r| (r.0, self.resolve_name(r.1)))
}
}
Expand Down
Loading
Loading