Added slotindexer and table status constructor
[iotcloud.git] / src / js / iotjs / src / slotbuffer.js
index 18288ffb0f4cd144bd0e8e6dc621f0b6902c32b2..97048529fe575a8432570a29b794aa4c502a7e65 100644 (file)
@@ -18,8 +18,8 @@ var SlotBuffer = function () {
        _createClass(SlotBuffer, [{
                key: "size",
                value: function size() {
-                       if (this.head >= tail) {
-                               return head - tail;
+                       if (this.head >= this.tail) {
+                               return this.head - this.tail;
                        }
                        return this.array.length + this.head - this.tail;
                }
@@ -96,7 +96,7 @@ var SlotBuffer = function () {
                                return null;
                        }
 
-                       if (this.head >= this.tail && index >= head) {
+                       if (this.head >= this.tail && index >= this.head) {
                                return null;
                        }