diff options
author | Alon Zakai <azakai@mozilla.com> | 2010-11-27 20:58:19 -0800 |
---|---|---|
committer | Alon Zakai <azakai@mozilla.com> | 2010-11-27 20:58:19 -0800 |
commit | e0f339fe650ade07087f3e8df8e468bdb5b46a35 (patch) | |
tree | 1d773e832969226245cfb623d487320252d63a0e /src/utility.js | |
parent | c3f19a35f46dfc0879862212140867cb1998cc65 (diff) |
fix bug in laying out of constant structures +tests
Diffstat (limited to 'src/utility.js')
-rw-r--r-- | src/utility.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/utility.js b/src/utility.js index 391efb14..5020c911 100644 --- a/src/utility.js +++ b/src/utility.js @@ -8,7 +8,12 @@ function safeQuote(x) { function dump(item) { var CHUNK = 500; function lineify(text) { - return text.replace(/.{80}/g, '$&\n'); + var ret = ''; + while (text.length > 80) { + ret += '// ' + text.substr(0,80) + '\n'; + text = text.substr(80); + } + return ret + '// ' + text; } try { return lineify(JSON.stringify(item)); |