Latest Results
uc/05-14-fix_transformer_object-rest-spread_correct_scope_id_when_moving_bindings uc/05-14-fix_transformer_object-rest-spread_correct_scope_id_when_moving_bindings fix(codegen): keep `Object.defineProperty` property name as plain string in minify (#22400)
Fix `cjs-module-lexer` failing to detect `Object.defineProperty(exports, "name", ...)` named exports after oxc minify.
`calculate_quote_maybe_backtick` favored backtick when all three quote costs tied at zero, so a plain ASCII property name like `"getInclusionReasons"` was emitted as a backtick template. [`cjs-module-lexer`](https://github.com/nodejs/cjs-module-lexer) (used by Node for CJS/ESM interop) only matches plain string literals there, so the affected exports silently dropped out of its export set ā downstream ESM consumers then failed with `Named export 'X' not found`.
In `CallExpression::gen_expr`, detect `Object.defineProperty` / `Reflect.defineProperty` and print the 2nd argument via `print_string_literal(name, false)` (the existing `allow_backtick: false` path). Other arguments ā and nested strings inside the descriptor ā still benefit from backtick optimization. Minify-only: outside minify, `print_string_literal` uses `self.quote` (never backtick), and `print_arguments` is needed there to preserve argument comments.
### Before / after
```js
// input
Object.defineProperty(exports, "getInclusionReasons", { ... });
```
```js
// before
Object.defineProperty(exports,`getInclusionReasons`,{...});
// after
Object.defineProperty(exports,"getInclusionReasons",{...});
```
Closes #22342
AI assisted. Latest Branches
0%
c/05-14-fix_transformer_object-rest-spread_correct_scope_id_when_moving_bindings 0%
c/05-14-perf_transformer_object-rest-spread_collect_vec_symbolid_over_vec_ident_ -5%
eryue0220:feat/minifier-unused-properties Ā© 2026 CodSpeed Technology