From: Jay Freeman (saurik) Date: Mon, 21 Dec 2015 14:25:50 +0000 (-0800) Subject: Print the sort-of stack trace from JavaScriptCore. X-Git-Tag: v0.9.590~162 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/9e85a60e4b0868dd9bd92b10e08fc1f6b7025516 Print the sort-of stack trace from JavaScriptCore. --- diff --git a/libcycript.cy b/libcycript.cy index 6a751aa..4e4a49e 100644 --- a/libcycript.cy +++ b/libcycript.cy @@ -33,7 +33,12 @@ $cy_set(Date.prototype, { $cy_set(Error.prototype, { toCYON: function() { - return `new ${this.constructor.name}(${this.message.toCYON()})`; + let stack = this.stack.split('\n'); + if (stack.slice(-1)[0] == "global code") + stack = stack.slice(0, -1); + for (let i = 0; i != stack.length; ++i) + stack[i] = '\n ' + stack[i]; + return `new ${this.constructor.name}(${this.message.toCYON()}) /*${stack.join('')} */`; }, });