Browse Source

Lint fixes

Lutz Roeder 7 years ago
parent
commit
fa84dbde4d
3 changed files with 11 additions and 9 deletions
  1. 8 6
      src/pickle.js
  2. 1 1
      src/tflite.js
  3. 2 2
      test/test.js

+ 8 - 6
src/pickle.js

@@ -13,6 +13,8 @@ pickle.Unpickler = class {
         var i;
         var start;
         var obj;
+        var type;
+        var args;
         var reader = this._reader;
         var stack = [];
         var marker = [];
@@ -37,7 +39,7 @@ pickle.Unpickler = class {
                     table[reader.line()] = stack[stack.length - 1];
                     break;
                 case pickle.OpCode.OBJ:
-                    var args = stack.splice(marker.pop());
+                    args = stack.splice(marker.pop());
                     stack.push(function_call(args.pop(), args));
                     break;
                 case pickle.OpCode.GET:
@@ -60,14 +62,14 @@ pickle.Unpickler = class {
                     stack.push(persistent_load(stack.pop()));
                     break;
                 case pickle.OpCode.REDUCE:
-                    var args = stack.pop();
-                    var type = stack.pop();
+                    args = stack.pop();
+                    type = stack.pop();
                     stack.push(function_call(type, args));
                     break;
                 case pickle.OpCode.NEWOBJ:
-                    var newObjArgs = stack.pop();
-                    var newObjType = stack.pop();
-                    stack.push(function_call(newObjType, newObjArgs));
+                    args = stack.pop();
+                    type = stack.pop();
+                    stack.push(function_call(type, args));
                     break;
                 case pickle.OpCode.BINGET:
                     stack.push(table[reader.byte()]);

+ 1 - 1
src/tflite.js

@@ -259,7 +259,7 @@ tflite.Node = class {
                                     value = activationFunctionMap[value];
                                 }
                                 this._chain = [];
-                                this._chain.push(new tflite.Node(metadata, null, value, null, []));
+                                this._chain.push(new tflite.Node(metadata, null, value, '', []));
                             }
                         }
                         this._attributes.push(attribute);

+ 2 - 2
test/test.js

@@ -519,8 +519,8 @@ function loadModel(target, item, callback) {
                     }
                     if (node.chain) {
                         for (var chain of node.chain) {
-                            (node.name || '').length;
-                            node.name.toString();
+                            chain.name.toString();
+                            chain.name.length;
                         }
                     }
                 }