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: comments #6599

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
7 changes: 4 additions & 3 deletions crates/oxc_transformer/src/common/helper_loader.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Utility transform to load helper functions
//! Utility transform to load helper functions.
//!
//! This module provides functionality to load helper functions in different modes.
//! It supports runtime, external, and inline (not yet implemented) modes for loading helper functions.
Expand Down Expand Up @@ -109,6 +109,7 @@ pub enum HelperLoaderMode {
Runtime,
}

/// Helper loader options.
#[derive(Clone, Debug, Deserialize)]
pub struct HelperLoaderOptions {
#[serde(default = "default_as_module_name")]
Expand Down Expand Up @@ -182,7 +183,7 @@ impl<'a> HelperLoaderStore<'a> {
}
}

/// Load and call a helper function and return the `CallExpression`.
/// Load and call a helper function and return a `CallExpression`.
#[expect(dead_code)]
pub fn call(
&mut self,
Expand Down Expand Up @@ -218,7 +219,7 @@ impl<'a> HelperLoaderStore<'a> {
)
}

/// Load a helper function and return the callee expression.
/// Load a helper function and return a callee expression.
pub fn load(&self, helper: Helper, ctx: &mut TraverseCtx<'a>) -> Expression<'a> {
match self.mode {
HelperLoaderMode::Runtime => self.transform_for_runtime_helper(helper, ctx),
Expand Down
Loading