sourceMap.findOrigin(lineNumber, columnNumber)


  • lineNumber <number> 在生成的源代码中调用位置的 1 起始索引行号
  • columnNumber <number> 在生成的源代码中调用点的 1 索引列号
  • 返回:<Object>

给定生成源代码中调用位置的从 1 开始索引的 lineNumbercolumnNumber,找到原始源代码中对应的调用位置。

🌐 Given a 1-indexed lineNumber and columnNumber from a call site in the generated source, find the corresponding call site location in the original source.

如果提供的 lineNumbercolumnNumber 在任何源映射中都未找到,则返回一个空对象。否则,返回的对象包含以下键:

🌐 If the lineNumber and columnNumber provided are not found in any source map, then an empty object is returned. Otherwise, the returned object contains the following keys:

  • name <string> | <undefined> 如果提供了源映射,则为范围的名称
  • fileName <string> 在 SourceMap 中报告的原始源文件名称
  • lineNumber <number> 原始源代码中对应调用位置的从1开始索引的行号
  • columnNumber <number> 原始源代码中对应调用位置的从1开始索引的列号