Skip to content

Commit

Permalink
Filter "webpack:///" from the front of source file paths for display.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jim Hague committed Jul 15, 2021
1 parent aec833a commit b2c942f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion react_juce/core/EcmascriptEngine_Hermes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,11 @@ namespace reactjuce
if (maps.find(source) == maps.end())
maps.insert({source, std::make_unique<SourceMap>(source, juce::File(source + ".map"))});
const auto newloc = maps[source]->translate(line, col);
juce::String file = newloc.file;
if (file.startsWith("webpack:///"))
file = newloc.file.replaceFirstOccurrenceOf("webpack:///", "");

res += juce::String(m.prefix().str()) + "(" + newloc.file + ":" + juce::String(newloc.line) + ":" + juce::String(newloc.col) + ")";
res += juce::String(m.prefix().str()) + "(" + file + ":" + juce::String(newloc.line) + ":" + juce::String(newloc.col) + ")";
s = m.suffix();
}
return res + s;
Expand Down

0 comments on commit b2c942f

Please sign in to comment.