Files
bun-src/test/bundler/transpiler/react-compiler-fixtures/object-literal-method-call-in-ternary-test.expect.md
2026-08-27 21:09:14 +00:00

878 B

Input

import {
  createHookWrapper,
  identity,
  CONST_STRING0,
  CONST_STRING1,
} from 'shared-runtime';

function useHook({value}) {
  return {
    getValue() {
      return identity(value);
    },
  }.getValue()
    ? CONST_STRING0
    : CONST_STRING1;
}

export const FIXTURE_ENTRYPOINT = {
  fn: createHookWrapper(useHook),
  params: [{value: 0}],
};

Code

import {
  createHookWrapper,
  identity,
  CONST_STRING0,
  CONST_STRING1,
} from "shared-runtime";

function useHook(t0) {
  const { value } = t0;
  return {
    getValue() {
      return identity(value);
    },
  }.getValue()
    ? CONST_STRING0
    : CONST_STRING1;
}

export const FIXTURE_ENTRYPOINT = {
  fn: createHookWrapper(useHook),
  params: [{ value: 0 }],
};

Eval output

(kind: ok)

{"result":"global string 1","shouldInvokeFns":true}