Repository: facebook/react
File: packages/react-server/src/ReactFlightServer.js (JavaScript)

Code before:
  request: Request,
  task: Task,
  thenable: Thenable<any>,
): void {
  let debugInfo: ?ReactDebugInfo;
  if (__DEV__) {
    // If this came from Flight, forward any debug info into this new row.
    debugInfo = thenable._debugInfo;
    if (debugInfo) {
      forwardDebugInfo(request, task, debugInfo);
    }
  }
  if (
    enableProfilerTimer &&
    enableComponentPerformanceTrack &&
    enableAsyncDebugInfo
  ) {
    const sequence = getCurrentAsyncSequence();
    if (sequence !== null) {
      emitAsyncSequence(request, task, sequence, debugInfo, null, null);
    }
  }
}

function forwardDebugInfoFromAbortedTask(request: Request, task: Task): void {
  // If we a task is aborted, we can still include as much debug info as we can from the
  // value that we have so far.
  const model: any = task.model;
  if (typeof model !== 'object' || model === null) {
    return;
  }
  let debugInfo: ?ReactDebugInfo;
  if (__DEV__) {
    // If this came from Flight, forward any debug info into this new row.
    debugInfo = model._debugInfo;
    if (debugInfo) {
      forwardDebugInfo(request, task, debugInfo);
    }
  }
  if (
    enableProfilerTimer &&
    enableComponentPerformanceTrack &&
    enableAsyncDebugInfo
  ) {
    let thenable: null | Thenable<any> = null;
    if (typeof model.then === 'function') {
      thenable = (model: any);
    } else if (model.$$typeof === REACT_LAZY_TYPE) {
      const payload = model._payload;
      const init = model._init;
      try {

Review comment (bug):
```suggestion
  // If a task is aborted, we can still include as much debug info as we can from the
```

Code after:
  request: Request,
  task: Task,
  thenable: Thenable<any>,
): void {
  let debugInfo: ?ReactDebugInfo;
  if (__DEV__) {
    // If this came from Flight, forward any debug info into this new row.
    debugInfo = thenable._debugInfo;
    if (debugInfo) {
      forwardDebugInfo(request, task, debugInfo);
    }
  }
  if (
    enableProfilerTimer &&
    enableComponentPerformanceTrack &&
    enableAsyncDebugInfo
  ) {
    const sequence = getCurrentAsyncSequence();
    if (sequence !== null) {
      emitAsyncSequence(request, task, sequence, debugInfo, null, null);
    }
  }
}

function forwardDebugInfoFromAbortedTask(request: Request, task: Task): void {
  // If a task is aborted, we can still include as much debug info as we can from the
  // value that we have so far.
  const model: any = task.model;
  if (typeof model !== 'object' || model === null) {
    return;
  }
  let debugInfo: ?ReactDebugInfo;
  if (__DEV__) {
    // If this came from Flight, forward any debug info into this new row.
    debugInfo = model._debugInfo;
    if (debugInfo) {
      forwardDebugInfo(request, task, debugInfo);
    }
  }
  if (
    enableProfilerTimer &&
    enableComponentPerformanceTrack &&
    enableAsyncDebugInfo
  ) {
    let thenable: null | Thenable<any> = null;
    if (typeof model.then === 'function') {
      thenable = (model: any);
    } else if (model.$$typeof === REACT_LAZY_TYPE) {
      const payload = model._payload;
      const init = model._init;
      try {