Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/default-param-array-with-unary.expect.md
2026-08-27 21:09:14 +00:00

546 B

Input

function Component(x = [-1, 1]) {
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [],
};

Code

import { c as _c } from "react/compiler-runtime";
function Component(t0) {
  const $ = _c(2);
  let t1;
  if ($[0] !== t0) {
    t1 = t0 === undefined ? [-1, 1] : t0;
    $[0] = t0;
    $[1] = t1;
  } else {
    t1 = $[1];
  }
  const x = t1;
  return x;
}

export const FIXTURE_ENTRYPOINT = {
  fn: Component,
  params: [],
};

Eval output

(kind: ok) [-1,1]