Skip to content

Commit

Permalink
refactor: 🎨 use take over clone
Browse files Browse the repository at this point in the history
  • Loading branch information
stormslowly committed Jan 2, 2024
1 parent 07e25a2 commit d5254ed
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/mako/src/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,13 @@ fn transform_js(

// preset-env and other folders must be after plugin transform
// because plugin transform may inject some code that may need syntax transform
ast.body = folders.fold_module(ast.clone()).body;
let body = ast.body.take();
let module = Module {
span: ast.span,
shebang: ast.shebang.clone(),
body,
};
ast.body = folders.fold_module(module).body;

// inject helpers must after decorators
// since decorators will use helpers
Expand Down

0 comments on commit d5254ed

Please sign in to comment.