src/language-js/loc.js/composeLoc
function composeLoc(startNode, endNodeOrLength = startNode) {
  const start = locStart(startNode);
  const end =
    typeof endNodeOrLength === "number"
      ? start + endNodeOrLength
      : locEnd(endNodeOrLength);

  return {
    range: [start, end],
  };
}