Skip to content
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
5 changes: 3 additions & 2 deletions crates/oxc_transformer/src/utils/ast_builder.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use oxc_ast::{ast::*, NONE};
use oxc_semantic::ScopeFlags;
use oxc_span::SPAN;
use oxc_span::{GetSpan, SPAN};
use oxc_traverse::TraverseCtx;

/// `object` -> `object.call`.
Expand Down Expand Up @@ -48,6 +48,7 @@ pub(crate) fn wrap_expression_in_arrow_function_iife<'a>(
let scope_id =
ctx.insert_scope_below_expression(&expr, ScopeFlags::Arrow | ScopeFlags::Function);

let span = expr.span();
let kind = FormalParameterKind::ArrowFormalParameters;
let params = ctx.ast.formal_parameters(SPAN, kind, ctx.ast.vec(), NONE);
let statements = ctx.ast.vec1(ctx.ast.statement_return(SPAN, Some(expr)));
Expand All @@ -57,7 +58,7 @@ pub(crate) fn wrap_expression_in_arrow_function_iife<'a>(
);
// IIFE
ctx.ast.expression_call(
SPAN,
span,
Expression::ArrowFunctionExpression(arrow),
NONE,
ctx.ast.vec(),
Expand Down
Loading