Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/error.invalid-mutate-after-aliased-freeze.js
2026-08-27 21:09:14 +00:00

17 lines
282 B
JavaScript

function Component(props) {
let x = [];
let y = x;
if (props.p1) {
x = [];
}
let _ = <Component x={x} />;
// y is MaybeFrozen at this point, since it may alias to x
// (which is the above line freezes)
y.push(props.p2);
return <Component x={x} y={y} />;
}