diff --git a/src/js/devtool-log.js b/src/js/devtool-log.js index 38bd8a306..44a28c052 100644 --- a/src/js/devtool-log.js +++ b/src/js/devtool-log.js @@ -123,7 +123,7 @@ var renderLogBuffer = function(buffer) { /******************************************************************************/ var onBufferRead = function(buffer) { - if ( Array.isArray(buffer ) ) { + if ( Array.isArray(buffer) ) { renderLogBuffer(buffer); } setTimeout(readLogBuffer, 1000); @@ -142,13 +142,8 @@ var readLogBuffer = function() { /******************************************************************************/ var clearBuffer = function() { - var rows = tbody.rows; - var row; - var i = rows.length; - while ( i-- ) { - row = rows[i]; - row.parentNode.removeChild(row); - rowJunkyard.push(row); + while ( tbody.firstChild !== null ) { + rowJunkyard.push(tbody.removeChild(tbody.firstChild)); } }; diff --git a/src/js/pagestore.js b/src/js/pagestore.js index f5f52bf7e..3214b57d1 100644 --- a/src/js/pagestore.js +++ b/src/js/pagestore.js @@ -159,7 +159,7 @@ LogBuffer.prototype.writeOne = function(details, result) { if ( this.writePtr === this.readPtr ) { var toMove = this.buffer.slice(0, this.writePtr); var minSize = Math.ceil(this.size * 1.5); - this.size += this.writePtr; + this.size += toMove.length; if ( this.size < minSize ) { this.buffer = this.buffer.concat(toMove, new Array(minSize - this.size)); this.writePtr = this.size;