From 292e2ea5add821645540d12fde57a2546ed77463 Mon Sep 17 00:00:00 2001 From: Fedor Indutny Date: Sat, 17 Sep 2011 15:38:06 +0700 Subject: [PATCH] fix breakpoint prefixing in list() --- lib/_debugger.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lib/_debugger.js b/lib/_debugger.js index 9e1c5844cd7..3e28a3f4cb6 100644 --- a/lib/_debugger.js +++ b/lib/_debugger.js @@ -922,13 +922,17 @@ function intChars(n) { // Adds spaces and prefix to number function leftPad(n, prefix) { - var s = n.toString(); - var nchars = intChars(n); - var nspaces = nchars - s.length; + var s = n.toString(), + nchars = intChars(n), + nspaces = nchars - s.length - 1; + + prefix || (prefix = ' '); + for (var i = 0; i < nspaces; i++) { - s = (prefix || ' ') + s; + prefix += ' '; } - return s; + + return prefix + s; }