Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/todo-round3_outlined_naming.expect.md
T
2026-08-27 21:09:14 +00:00

1.1 KiB

Input

// @enableFunctionOutlining
// Minimized repro for C5: outlined function naming divergence.
// When source code has variables named _temp/_temp2, Babel's generateUid
// skips those names, but the Rust compiler's blind counter doesn't.
function Component(props) {
  const _temp = props.a;
  const _temp2 = props.b;
  return props.items.map(() => <div />);
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{a: 1, b: 2, items: [1, 2, 3]}],
};

Code

import { c as _c } from "react/compiler-runtime"; // @enableFunctionOutlining
// Minimized repro for C5: outlined function naming divergence.
// When source code has variables named _temp/_temp2, Babel's generateUid
// skips those names, but the Rust compiler's blind counter doesn't.
function Component(props) {
  const $ = _c(2);
  let t0;
  if ($[0] !== props.items) {
    t0 = props.items.map(_temp3);
    $[0] = props.items;
    $[1] = t0;
  } else {
    t0 = $[1];
  }
  return t0;
}
function _temp3() {
  return <div />;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [{ a: 1, b: 2, items: [1, 2, 3] }],
};