Skip to content

Commit

Permalink
feat(transformer): class static block transform (#6733)
Browse files Browse the repository at this point in the history
Add ES2022 class static block transform.
  • Loading branch information
overlookmotel committed Oct 22, 2024
1 parent 78fee6e commit 10484cd
Show file tree
Hide file tree
Showing 25 changed files with 700 additions and 5 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

11 changes: 11 additions & 0 deletions crates/oxc_semantic/src/scope.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ impl ScopeTree {
}
}

/// Delete a scope.
pub fn delete_scope(&mut self, scope_id: ScopeId) {
if self.build_child_ids {
self.child_ids[scope_id].clear();
let parent_id = self.parent_ids[scope_id];
if let Some(parent_id) = parent_id {
self.child_ids[parent_id].retain(|&child_id| child_id != scope_id);
}
}
}

/// Get a variable binding by name that was declared in the top-level scope
#[inline]
pub fn get_root_binding(&self, name: &str) -> Option<SymbolId> {
Expand Down
1 change: 1 addition & 0 deletions crates/oxc_transformer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ base64 = { workspace = true }
cow-utils = { workspace = true }
dashmap = { workspace = true }
indexmap = { workspace = true }
itoa = { workspace = true }
ropey = { workspace = true }
rustc-hash = { workspace = true }
serde = { workspace = true, features = ["derive"] }
Expand Down
Loading

0 comments on commit 10484cd

Please sign in to comment.