Fix duplicated line message in errors

This commit is contained in:
Ne_Eo
2025-01-19 21:03:01 +01:00
parent 108b385e6c
commit 1aa136469d
+5 -1
View File
@@ -101,11 +101,15 @@ class HScript extends Script {
private function _errorHandler(error:Error) {
var fileName = error.origin;
var oldfn = '$fileName:${error.line}: ';
if(remappedNames.exists(fileName))
fileName = remappedNames.get(fileName);
var fn = '$fileName:${error.line}: ';
var err = error.toString();
if (err.startsWith(fn)) err = err.substr(fn.length);
while(err.startsWith(oldfn) || err.startsWith(fn)) {
if (err.startsWith(oldfn)) err = err.substr(oldfn.length);
if (err.startsWith(fn)) err = err.substr(fn.length);
}
Logs.traceColored([
Logs.logText(fn, GREEN),