From 0a4d6bce78c5cd6fa45e62365bdf22e9edde61bf Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Wed, 6 Jan 2016 23:57:12 -0800 Subject: [PATCH] Do not output an empty comment for an empty stack. --- libcycript.cy | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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}`; }, -- 2.45.2