Skip to content

Commit

Permalink
should use void 0 rather than null in property definition decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jan 24, 2025
1 parent 3fa1f03 commit 3aecdd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_transformer/src/decorator/legacy_decorator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ impl<'a> LegacyDecorator<'a, '_> {

// We emit `void 0` here to indicate to `__decorate` that it can invoke `Object.defineProperty` directly, but that it
// should not invoke `Object.getOwnPropertyDescriptor`.
let descriptor = ctx.ast.expression_null_literal(SPAN);
let descriptor = ctx.ast.void_0(SPAN);

(prop.r#static, &mut prop.key, descriptor, decorations)
}
Expand Down

0 comments on commit 3aecdd1

Please sign in to comment.