mirror of
https://github.com/oxc-project/oxc.git
synced 2026-09-14 19:36:11 +08:00
e3c6c4e739
Treat a named function expression’s private name as a function-entry binding through HIR, SSA, and alias analysis. This prevents self-references from reaching mutation inference uninitialized and adds fixture coverage. Closes #23752. Validated with targeted compiler and linter checks, workspace checking, and linting. AI-assisted.
24 lines
495 B
Plaintext
24 lines
495 B
Plaintext
---
|
|
source: crates/oxc_react_compiler/tests/snapshot.rs
|
|
input_file: crates/oxc_react_compiler/fixtures/issue-23752.tsx
|
|
---
|
|
import { c as _c } from "react/compiler-runtime";
|
|
export function Component(recursive) {
|
|
const $ = _c(1);
|
|
let t0;
|
|
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
t0 = function recursive_0(x) {
|
|
const read = () => recursive_0;
|
|
if (x) {
|
|
return read;
|
|
}
|
|
recursive_0 = null;
|
|
return read;
|
|
};
|
|
$[0] = t0;
|
|
} else {
|
|
t0 = $[0];
|
|
}
|
|
return t0;
|
|
}
|