Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/ssa-renaming-unconditional-ternary-with-mutation.js
2026-08-27 21:09:14 +00:00

21 lines
474 B
JavaScript

import {arrayPush} from 'shared-runtime';
function useFoo(props) {
let x = [];
x.push(props.bar);
props.cond
? ((x = {}), (x = []), x.push(props.foo))
: ((x = []), (x = []), x.push(props.bar));
arrayPush(x, 4);
return x;
}
export const FIXTURE_ENTRYPOINT = {
fn: useFoo,
params: [{cond: false, foo: 2, bar: 55}],
sequentialRenders: [
{cond: false, foo: 2, bar: 55},
{cond: false, foo: 3, bar: 55},
{cond: true, foo: 3, bar: 55},
],
};