java.lang.Object
org.htmlunit.corejs.javascript.sourcemap.SourceMapV3
- All Implemented Interfaces:
SourceMapper
A
SourceMapper backed by a parsed ECMA-426 plain source map. Indexed (sectioned) source
maps are not supported; calling parse(java.lang.String) on those will throw SourceMapException.-
Method Summary
Modifier and TypeMethodDescriptionfile()getMappedName(int targetLine, int targetColumn) Returns the original name for the symbol at the given target position, ornullif the segment has no name or the position is unmapped.Returns the full text of the primary original source so the debugger can display it during compilation handoff.getSourceLineText(String sourcePath, int lineNumber) Returns the text of the given line within the named original source file.mapPosition(int targetLine, int targetColumn) Maps a target(line, column)position to the corresponding original-source position.static SourceMapV3static SourceMapV3static SourceMapV3sources()
-
Method Details
-
parse
-
parse
- Throws:
IOException
-
parseFile
- Throws:
IOException
-
mapPosition
Description copied from interface:SourceMapperMaps a target(line, column)position to the corresponding original-source position.- Specified by:
mapPositionin interfaceSourceMapper- Parameters:
targetLine- 1-indexed line in the transpiled sourcetargetColumn- 1-indexed column in the transpiled source- Returns:
- the original-source position, or
nullif no mapping exists for this position
-
getMappedName
Returns the original name for the symbol at the given target position, ornullif the segment has no name or the position is unmapped.- Parameters:
targetLine- 1-indexed line in the transpiled sourcetargetColumn- 1-indexed column in the transpiled source
-
getSourceLineText
Description copied from interface:SourceMapperReturns the text of the given line within the named original source file. Used to populate parser error messages with the offending line from the original source.- Specified by:
getSourceLineTextin interfaceSourceMapper- Parameters:
sourcePath- the resolved source path (as returned inPosition.getSourcePath())lineNumber- 1-indexed line number in the original source- Returns:
- the line text, or
nullif the source is unknown, the line is out of range, or no original-source content is available
-
getPrimarySourceContent
Description copied from interface:SourceMapperReturns the full text of the primary original source so the debugger can display it during compilation handoff. When the underlying source map references multiple sources, an implementation must pick one (typically the first) — this method does not enumerate them.- Specified by:
getPrimarySourceContentin interfaceSourceMapper- Returns:
- the primary original source content, or
nullif it is not available
-
sources
-
ignoreList
-
file
-