mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
33d4ed9dec
Preserve named function expression names when the private name is unreferenced. This matches React Compiler lowering and avoids changing observable `Function.name` values. Validated with `just ready`. AI-assisted.
26 lines
612 B
Plaintext
26 lines
612 B
Plaintext
---
|
|
source: crates/oxc_react_compiler/tests/snapshot.rs
|
|
input_file: crates/oxc_react_compiler/fixtures/duplicate-named-function-expression-names.tsx
|
|
---
|
|
import { c as _c } from "react/compiler-runtime";
|
|
export function Component(t0) {
|
|
const $ = _c(2);
|
|
const { value } = t0;
|
|
let t1;
|
|
if ($[0] !== value) {
|
|
const columns = [{ render: function Render(input) {
|
|
const copy = input;
|
|
return copy + value;
|
|
} }, { render: function Render(input_0) {
|
|
const copy_0 = input_0;
|
|
return copy_0 + value;
|
|
} }];
|
|
t1 = <div>{columns}</div>;
|
|
$[0] = value;
|
|
$[1] = t1;
|
|
} else {
|
|
t1 = $[1];
|
|
}
|
|
return t1;
|
|
}
|