From 1e328c5b77a9c471f86a14776771e494b2f8d3cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Klar=C3=A9n?= <fys09akl@student.lu.se> Date: Wed, 4 Mar 2015 11:08:58 +0100 Subject: [PATCH] JsDoc added to allow compilation --- lib/js/lc.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/js/lc.js b/lib/js/lc.js index ceff9ca..4b87362 100644 --- a/lib/js/lc.js +++ b/lib/js/lc.js @@ -118,7 +118,7 @@ LabComm.Buffer.prototype.getString = function() { * @return {Boolean} A boolean */ LabComm.Buffer.prototype.getBoolean = function() { - return new Boolean(this.data_.getUint8(this.offset_++)); + return Boolean(this.data_.getUint8(this.offset_++)); }; /** @@ -258,10 +258,10 @@ LabComm.Decoder.prototype.decodeSignature_ = function(name, json, fb) { switch(type) { case LabComm.Constants.ARRAY: var dim = this.data.getVarint(); + console.log("array"); if(dim === 0) { throw "Array cant have 0 dimensions"; } - console.log("array"); //TODO: implement throw "Array decoding not implemented"; break; @@ -298,7 +298,7 @@ LabComm.Decoder.prototype.decodeSignature_ = function(name, json, fb) { case LabComm.Constants.STRING: return this.buildDecoder_(name, json, fb, "string", "data.getString()"); } - throw "Unknown type found in signature: 0x" + tag.toString(16); + throw "Unknown type found in signature: 0x" + type.toString(16); }; /** @@ -312,6 +312,8 @@ LabComm.Decoder.prototype.decodePackage = function(buffer) { var tag = this.data.getVarint(); var len = this.data.getVarint(); + console.log('0x' + tag.toString(16) + ':' + len); + switch(tag) { case LabComm.Constants.VERSION: var version = this.data.getString(); -- GitLab