Repository: facebook/react
File: packages/react-noop-renderer/src/ReactNoopFlightServer.js (JavaScript)

Code before:
    reference: {$$typeof: symbol, value: any},
  ) {
    return saveModule(reference.value);
  },
});

type Options = {
  environmentName?: string | (() => string),
  filterStackFrame?: (url: string, functionName: string) => boolean,
  identifierPrefix?: string,
  signal?: AbortSignal,
  debugChannel?: {onMessage?: (message: string) => void},
  onError?: (error: mixed) => void,
  startTime?: number,
};

function render(model: ReactClientValue, options?: Options): Destination {
  const destination: Destination = [];
  const bundlerConfig = undefined;
  const request = ReactNoopFlightServer.createRequest(
    model,
    bundlerConfig,
    options ? options.onError : undefined,
    options ? options.identifierPrefix : undefined,
    undefined,
    __PROFILE__ && options ? options.startTime : undefined,
    __DEV__ && options ? options.environmentName : undefined,
    __DEV__ && options ? options.filterStackFrame : undefined,
    __DEV__ && options && options.debugChannel !== undefined,
  );
  const signal = options ? options.signal : undefined;
  if (signal) {
    if (signal.aborted) {
      ReactNoopFlightServer.abort(request, (signal: any).reason);
    } else {
      const listener = () => {
        ReactNoopFlightServer.abort(request, (signal: any).reason);
        signal.removeEventListener('abort', listener);
      };
      signal.addEventListener('abort', listener);
    }
  }
  if (__DEV__ && options && options.debugChannel !== undefined) {
    options.debugChannel.onMessage = message => {
      ReactNoopFlightServer.resolveDebugMessage(request, message);
    };
  }
  ReactNoopFlightServer.startWork(request);
  ReactNoopFlightServer.startFlowing(request, destination);
  return destination;
}

Review comment (suggestion):
same here:

```suggestion
    options ? options.startTime : undefined,
```

Code after:
    reference: {$$typeof: symbol, value: any},
  ) {
    return saveModule(reference.value);
  },
});

type Options = {
  environmentName?: string | (() => string),
  filterStackFrame?: (url: string, functionName: string) => boolean,
  identifierPrefix?: string,
  signal?: AbortSignal,
  debugChannel?: {onMessage?: (message: string) => void},
  onError?: (error: mixed) => void,
  startTime?: number,
};

function render(model: ReactClientValue, options?: Options): Destination {
  const destination: Destination = [];
  const bundlerConfig = undefined;
  const request = ReactNoopFlightServer.createRequest(
    model,
    bundlerConfig,
    options ? options.onError : undefined,
    options ? options.identifierPrefix : undefined,
    undefined,
    options ? options.startTime : undefined,
    __DEV__ && options ? options.environmentName : undefined,
    __DEV__ && options ? options.filterStackFrame : undefined,
    __DEV__ && options && options.debugChannel !== undefined,
  );
  const signal = options ? options.signal : undefined;
  if (signal) {
    if (signal.aborted) {
      ReactNoopFlightServer.abort(request, (signal: any).reason);
    } else {
      const listener = () => {
        ReactNoopFlightServer.abort(request, (signal: any).reason);
        signal.removeEventListener('abort', listener);
      };
      signal.addEventListener('abort', listener);
    }
  }
  if (__DEV__ && options && options.debugChannel !== undefined) {
    options.debugChannel.onMessage = message => {
      ReactNoopFlightServer.resolveDebugMessage(request, message);
    };
  }
  ReactNoopFlightServer.startWork(request);
  ReactNoopFlightServer.startFlowing(request, destination);
  return destination;
}