JS: deobfuscate stack traces for wrapped native exceptions
@@ -228,6 +228,11 @@ function $rt_exception(ex) {
}
err.$javaException = ex;
ex.$jsException = err;
+ $rt_fillStack(err, ex);
+ }
+ return err;
+}
+function $rt_fillStack(err, ex) {
if (typeof $rt_decodeStack === "function" && err.stack) {
var stack = $rt_decodeStack(err.stack);
var javaStack = $rt_createArray($rt_objcls(), stack.length);
@@ -248,8 +253,6 @@ function $rt_exception(ex) {
}
}
}
- return err;
-}
function $rt_createMultiArray(cls, dimensions) {
var first = 0;
for (var i = dimensions.length - 1; i >= 0; i = (i - 1) | 0) {
@@ -553,6 +556,7 @@ function $rt_wrapException(err) {
ex = $rt_createException($rt_str("(JavaScript) " + err.toString()));
err.$javaException = ex;
ex.$jsException = err;
+ $rt_fillStack(err, ex);
}
return ex;
}
