Skip to content

Commit b2c942f

Browse files
author
Jim Hague
committed
Filter "webpack:///" from the front of source file paths for display.
1 parent aec833a commit b2c942f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

react_juce/core/EcmascriptEngine_Hermes.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,11 @@ namespace reactjuce
267267
if (maps.find(source) == maps.end())
268268
maps.insert({source, std::make_unique<SourceMap>(source, juce::File(source + ".map"))});
269269
const auto newloc = maps[source]->translate(line, col);
270+
juce::String file = newloc.file;
271+
if (file.startsWith("webpack:///"))
272+
file = newloc.file.replaceFirstOccurrenceOf("webpack:///", "");
270273

271-
res += juce::String(m.prefix().str()) + "(" + newloc.file + ":" + juce::String(newloc.line) + ":" + juce::String(newloc.col) + ")";
274+
res += juce::String(m.prefix().str()) + "(" + file + ":" + juce::String(newloc.line) + ":" + juce::String(newloc.col) + ")";
272275
s = m.suffix();
273276
}
274277
return res + s;

0 commit comments

Comments
 (0)