MCPcopy Create free account
hub / github.com/mozilla/rhino / mapLocation

Method mapLocation

rhino/src/main/java/org/mozilla/javascript/Parser.java:346–360  ·  view source on GitHub ↗
(int line, String lineSource, int offset)

Source from the content-addressed store, hash-verified

344 }
345
346 private MappedLocation mapLocation(int line, String lineSource, int offset) {
347 SourceMapper mapper = compilerEnv.getSourceMapper();
348 if (mapper != null) {
349 Position mapped = mapper.mapPosition(line, offset);
350 if (mapped != null) {
351 line = mapped.getLine();
352 offset = mapped.getColumn();
353 String mappedLine = mapper.getSourceLineText(mapped.getSourcePath(), line);
354 if (mappedLine != null) {
355 lineSource = mappedLine;
356 }
357 }
358 }
359 return new MappedLocation(line, lineSource, offset);
360 }
361
362 String lookupMessage(String messageId) {
363 return lookupMessage(messageId, null);

Callers 3

mapCurrentPosMethod · 0.95
addWarningMethod · 0.95
addErrorMethod · 0.95

Calls 6

mapPositionMethod · 0.95
getLineMethod · 0.95
getColumnMethod · 0.95
getSourceLineTextMethod · 0.95
getSourcePathMethod · 0.95
getSourceMapperMethod · 0.45

Tested by

no test coverage detected