Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(transformer): HelperLoader common transform: remove Rcs #6564

Merged
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
9 changes: 4 additions & 5 deletions crates/oxc_transformer/src/common/helper_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
use std::{
borrow::Cow,
cell::{Cell, RefCell},
rc::Rc,
};

use oxc_allocator::Vec;
Expand Down Expand Up @@ -154,9 +153,9 @@ pub struct HelperLoaderStore<'a> {
mode: HelperLoaderMode,
module_name: Cow<'static, str>,
/// Symbol ID for the `babelHelpers`.
babel_helpers_symbol_id: Rc<Cell<Option<SymbolId>>>,
babel_helpers_symbol_id: Cell<Option<SymbolId>>,
/// Loaded helpers, determined what helpers are loaded and what imports should be added.
loaded_helpers: Rc<RefCell<LoadedHelper<'a>>>,
loaded_helpers: RefCell<LoadedHelper<'a>>,
}

// Public methods
Expand All @@ -165,8 +164,8 @@ impl<'a> HelperLoaderStore<'a> {
Self {
mode: options.mode,
module_name: options.module_name.clone(),
loaded_helpers: Rc::new(RefCell::new(FxHashMap::default())),
babel_helpers_symbol_id: Rc::new(Cell::new(None)),
loaded_helpers: RefCell::new(FxHashMap::default()),
babel_helpers_symbol_id: Cell::new(None),
}
}

Expand Down