Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/try-catch-try-immediately-throws-after-constant-propagation.expect.md
2026-08-27 21:09:14 +00:00

542 B

Input

function Component(props) {
  let x = props.default;
  const y = 42;
  try {
    // note: this constant propagates so that we know
    // the handler is unreachable
    return y;
  } catch (e) {
    x = e;
  }
  return x;
}

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

Code

function Component(props) {
  let x;

  return 42;
}

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

Eval output

(kind: ok) 42