mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(transformer): remove an AstBuilder::copy call (#4983)
Remove one usage of unsound `AstBuilder::copy` method, using the new `get_inner_expression_mut` method introduced in #4920.
This commit is contained in:
parent
4796ece77d
commit
edacf936ec
1 changed files with 2 additions and 2 deletions
|
|
@ -217,8 +217,8 @@ impl<'a> TypeScriptAnnotations<'a> {
|
|||
|
||||
pub fn transform_expression(&mut self, expr: &mut Expression<'a>) {
|
||||
if expr.is_typescript_syntax() {
|
||||
// SAFETY: `ast.copy` is unsound! We need to fix.
|
||||
*expr = unsafe { self.ctx.ast.copy(expr.get_inner_expression()) };
|
||||
let inner_expr = expr.get_inner_expression_mut();
|
||||
*expr = self.ctx.ast.move_expression(inner_expr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue