mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 00:24:11 -08:00
JS: deobfuscate stack traces for wrapped native exceptions
This commit is contained in:
parent
42aedf770b
commit
daeaa502d6
|
@ -228,6 +228,11 @@ function $rt_exception(ex) {
|
||||||
}
|
}
|
||||||
err.$javaException = ex;
|
err.$javaException = ex;
|
||||||
ex.$jsException = err;
|
ex.$jsException = err;
|
||||||
|
$rt_fillStack(err, ex);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
function $rt_fillStack(err, ex) {
|
||||||
if (typeof $rt_decodeStack === "function" && err.stack) {
|
if (typeof $rt_decodeStack === "function" && err.stack) {
|
||||||
var stack = $rt_decodeStack(err.stack);
|
var stack = $rt_decodeStack(err.stack);
|
||||||
var javaStack = $rt_createArray($rt_objcls(), stack.length);
|
var javaStack = $rt_createArray($rt_objcls(), stack.length);
|
||||||
|
@ -247,8 +252,6 @@ function $rt_exception(ex) {
|
||||||
$rt_setStack(ex, javaStack);
|
$rt_setStack(ex, javaStack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return err;
|
|
||||||
}
|
}
|
||||||
function $rt_createMultiArray(cls, dimensions) {
|
function $rt_createMultiArray(cls, dimensions) {
|
||||||
var first = 0;
|
var first = 0;
|
||||||
|
@ -553,6 +556,7 @@ function $rt_wrapException(err) {
|
||||||
ex = $rt_createException($rt_str("(JavaScript) " + err.toString()));
|
ex = $rt_createException($rt_str("(JavaScript) " + err.toString()));
|
||||||
err.$javaException = ex;
|
err.$javaException = ex;
|
||||||
ex.$jsException = err;
|
ex.$jsException = err;
|
||||||
|
$rt_fillStack(err, ex);
|
||||||
}
|
}
|
||||||
return ex;
|
return ex;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user