]> git.saurik.com Git - cycript.git/commitdiff
Do not output an empty comment for an empty stack.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jan 2016 07:57:12 +0000 (23:57 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 7 Jan 2016 07:57:12 +0000 (23:57 -0800)
libcycript.cy

index 510bbc22e0dfe85a0e0f00d638b711549106654f..45caaf2ff15d75e34e8d771833af76d2e02bda82 100644 (file)
@@ -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}`;
     },