diff options
author | Alon Zakai <alonzakai@gmail.com> | 2012-02-04 21:16:45 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2012-02-04 21:16:45 -0800 |
commit | 3e7c8fb5e15ab6786da8cc72a802720e224271d1 (patch) | |
tree | 61d74e0bf30e00d82c588306745d3a339fdadf4d /src/utility.js | |
parent | 1cb7cf18b704920eeead32b3ea681780c3aad05e (diff) |
refactor out the 'assign' intertype, simplifying and optimizing the compiler
Diffstat (limited to 'src/utility.js')
-rw-r--r-- | src/utility.js | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/utility.js b/src/utility.js index 5c934483..4ffe46a0 100644 --- a/src/utility.js +++ b/src/utility.js @@ -9,17 +9,8 @@ function safeQuote(x) { } function dump(item) { - var CHUNK = 500; - function lineify(text) { - 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).substr(0, 80*25)); + return '// ' + JSON.stringify(item, null, ' ').replace(/\n/g, '\n// '); } catch(e) { var ret = []; for (var i in item) { |