Skip to content

Commit abea51a

Browse files
authored
build: Update SWC dependencies (#30)
1 parent e5a675d commit abea51a

File tree

4 files changed

+81
-96
lines changed

4 files changed

+81
-96
lines changed

Cargo.lock

Lines changed: 73 additions & 88 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ repository = "https://github.com/getsentry/js-source-scopes"
1414
[dependencies]
1515
indexmap = "2.8.0"
1616
sourcemap = "9.1.2"
17-
swc_common = "8.0.0"
18-
swc_ecma_parser = "10.0.1"
19-
swc_ecma_visit = { version = "8.0.0", features = ["path"] }
17+
swc_common = "17.0.1"
18+
swc_ecma_parser = "27.0.7"
19+
swc_ecma_visit = { version = "18.0.1", features = ["path"] }
2020
thiserror = "2.0.12"
2121
tracing = "0.1.36"

src/scope_index.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl ScopeIndex {
8484
}
8585

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

102-
fn resolve_name(&self, name_idx: u32) -> ScopeLookupResult {
102+
fn resolve_name(&self, name_idx: u32) -> ScopeLookupResult<'_> {
103103
if name_idx == GLOBAL_SCOPE_SENTINEL {
104104
ScopeLookupResult::Unknown
105105
} else if name_idx == ANONYMOUS_SCOPE_SENTINEL {
@@ -116,7 +116,7 @@ impl ScopeIndex {
116116
/// offsets.
117117
///
118118
/// Scopes are returned in order of their starting offsets.
119-
pub fn iter(&self) -> impl Iterator<Item = (u32, ScopeLookupResult)> {
119+
pub fn iter(&self) -> impl Iterator<Item = (u32, ScopeLookupResult<'_>)> {
120120
self.ranges.iter().map(|r| (r.0, self.resolve_name(r.1)))
121121
}
122122
}

0 commit comments

Comments
 (0)