From: Jay Freeman (saurik) Date: Thu, 7 Jan 2016 07:57:12 +0000 (-0800) Subject: Do not output an empty comment for an empty stack. X-Git-Tag: v0.9.590~43 X-Git-Url: https://git.saurik.com/cycript.git/commitdiff_plain/0a4d6bce78c5cd6fa45e62365bdf22e9edde61bf Do not output an empty comment for an empty stack. --- diff --git a/libcycript.cy b/libcycript.cy index 510bbc2..45caaf2 100644 --- a/libcycript.cy +++ b/libcycript.cy @@ -62,8 +62,12 @@ $cy_set(Error.prototype, { stack = stack.slice(0, -1); for (let i = 0; i != stack.length; ++i) stack[i] = '\n ' + stack[i]; - stack = stack.join(''); - stack = ` /*${stack} */`; + if (stack.length == 0) + stack = ''; + else { + stack = stack.join(''); + stack = ` /*${stack} */`; + } } return `new ${this.constructor.name}(${this.message.toCYON()})${stack}`; },