diff --git a/lib/dust.js b/lib/dust.js index cccc35f8..4e8d067d 100755 --- a/lib/dust.js +++ b/lib/dust.js @@ -181,8 +181,8 @@ Context.prototype.current = function() { Context.prototype.getBlock = function(key, chk, ctx) { if (typeof key === "function") { - key = key(chk, ctx).data; - chk.data = ""; + key = key(chk, ctx).data.join(""); + chk.data = []; //ie7 perf } var blocks = this.blocks; @@ -229,7 +229,7 @@ Stub.prototype.flush = function() { while (chunk) { if (chunk.flushable) { - this.out += chunk.data; + this.out += chunk.data.join(""); //ie7 perf } else if (chunk.error) { this.callback(chunk.error); this.flush = function() {}; @@ -252,7 +252,7 @@ Stream.prototype.flush = function() { while(chunk) { if (chunk.flushable) { - this.emit('data', chunk.data); + this.emit('data', chunk.data.join("")); //ie7 perf } else if (chunk.error) { this.emit('error', chunk.error); this.flush = function() {}; @@ -308,7 +308,7 @@ Stream.prototype.pipe = function(stream) { function Chunk(root, next, taps) { this.root = root; this.next = next; - this.data = ''; + this.data = []; //ie7 perf this.flushable = false; this.taps = taps; } @@ -319,7 +319,7 @@ Chunk.prototype.write = function(data) { if (taps) { data = taps.go(data); } - this.data += data; + this.data.push(data); return this; }; diff --git a/test/uutest.js b/test/uutest.js index 79aa7a82..97415e46 100644 --- a/test/uutest.js +++ b/test/uutest.js @@ -20,11 +20,11 @@ Test.prototype.run = function() { } Test.prototype.equals = function(actual, expected, message) { - if (actual !== expected) { - var err = new Error(); - if (message) err.message = message; - throw wrapAssertionError(err, actual, expected, "==="); - } + if (actual !== expected) { + var err = new Error(); + if (message) err.message = message; + throw wrapAssertionError(err, actual, expected, "==="); + } } Test.prototype.ifError = function(err) {