iginal) {
    return frame;
  }

  const source = (0, _selectors.getSource)(getState(), frame.location.sourceId);

  if (!source) {
    return frame;
  }

  const symbols = (0, _selectors.getSymbols)(getState(), source);

  if (!symbols || !symbols.functions) {
    return frame;
  }

  const originalFunction = (0, _ast.findClosestFunction)(symbols, frame.location);

  if (!originalFunction) {
    return frame;
  }

  const originalDisplayName = originalFunction.name;
  return { ...frame,
    originalDisplayName
  };
}

function mapDisplayNames(cx) {
  return function ({
    dispatch,
    getState
  }) {
    const frames = (0, _selectors.getFrames)(getState(), cx.thread);

    if (!frames) {
      return;
    }

    const mappedFrames = frames.map(frame => mapDisplayName(frame, {
      getState
    }));
    dispatch({
      type: "MAP_FRAME_DISPLAY_NAMES",
      cx,
      thread: cx.thread,
      frames: mappedFrames
    });
  };
}PK