Skip to content

Commit

Permalink
fix(napi/transform): fix wrong isolated declarations emit
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Aug 8, 2024
1 parent 69dc6c9 commit 4d0b40a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions napi/transform/src/isolated_declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@ pub fn isolated_declaration(filename: String, source_text: String) -> IsolatedDe
let allocator = Allocator::default();
let ctx = TransformContext::new(&allocator, &filename, &source_text, source_type, None);
let transformed_ret = build_declarations(&ctx);

IsolatedDeclarationsResult {
source_text: transformed_ret.source_text,
errors: ctx.take_and_render_reports(),
}
}

pub(crate) fn build_declarations(ctx: &TransformContext<'_>) -> CodegenReturn {
let transformed_ret = IsolatedDeclarations::new(ctx.allocator).build(&ctx.program_mut());
let transformed_ret = IsolatedDeclarations::new(ctx.allocator).build(&ctx.program());
ctx.add_diagnostics(transformed_ret.errors);
ctx.codegen::<false>().build(&ctx.program())
ctx.codegen::<false>().build(&transformed_ret.program)
}

0 comments on commit 4d0b40a

Please sign in to comment.