Skip to content
Snippets Groups Projects
Commit 1e328c5b authored by Anton Klarén's avatar Anton Klarén
Browse files

JsDoc added to allow compilation

parent bc0619c3
Branches
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment