diff --git a/crates/oxc_transformer/src/proposals/explicit_resource_management.rs b/crates/oxc_transformer/src/proposals/explicit_resource_management.rs index 48afc2b5f1911..b8437536fd9bd 100644 --- a/crates/oxc_transformer/src/proposals/explicit_resource_management.rs +++ b/crates/oxc_transformer/src/proposals/explicit_resource_management.rs @@ -559,7 +559,7 @@ impl<'a> ExplicitResourceManagement<'a, '_> { let Some(using_ctx) = using_ctx else { return }; - let block_stmt_sid = ctx.create_child_scope(ctx.current_scope_id(), ScopeFlags::empty()); + let block_stmt_sid = ctx.create_child_scope_of_current(ScopeFlags::empty()); ctx.scoping_mut().change_scope_parent_id(switch_stmt_scope_id, Some(block_stmt_sid)); @@ -585,7 +585,7 @@ impl<'a> ExplicitResourceManagement<'a, '_> { ctx.ast.block_statement_with_scope_id(SPAN, vec, block_stmt_sid) }; - let catch = Self::create_catch_clause(&using_ctx, ctx.current_scope_id(), ctx); + let catch = Self::create_catch_clause(&using_ctx, current_scope_id, ctx); let finally = Self::create_finally_block(&using_ctx, current_scope_id, needs_await, ctx); *stmt = ctx.ast.statement_try(SPAN, block, Some(catch), Some(finally)); }