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
3 changes: 3 additions & 0 deletions crates/oxc_semantic/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
if self.scope.get_flags(parent_scope_id).is_catch_clause() {
let parent_bindings =
self.scope.get_bindings_mut(parent_scope_id).drain(..).collect::<Bindings>();
parent_bindings.values().for_each(|symbol_id| {
self.symbols.set_scope_id(*symbol_id, self.current_scope_id);
});
*self.scope.get_bindings_mut(self.current_scope_id) = parent_bindings;
}

Expand Down
5 changes: 5 additions & 0 deletions crates/oxc_semantic/src/symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ impl SymbolTable {
self.flags[symbol_id] |= includes;
}

#[inline]
pub fn set_scope_id(&mut self, symbol_id: SymbolId, scope_id: ScopeId) {
self.scope_ids[symbol_id] = scope_id;
}

#[inline]
pub fn get_scope_id(&self, symbol_id: SymbolId) -> ScopeId {
self.scope_ids[symbol_id]
Expand Down
5 changes: 2 additions & 3 deletions tasks/transform_conformance/babel.snap.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
commit: 12619ffe

Passed: 434/927
Passed: 435/927

# All Passed:
* babel-preset-react
Expand Down Expand Up @@ -445,8 +445,7 @@ Passed: 434/927
* opts/optimizeConstEnums/input.ts
* opts/rewriteImportExtensions/input.ts

# babel-plugin-transform-typescript (90/151)
* catch-clause/param-type/input.ts
# babel-plugin-transform-typescript (91/151)
* class/accessor-allowDeclareFields-false/input.ts
* class/accessor-allowDeclareFields-true/input.ts
* enum/boolean-value/input.ts
Expand Down