Commits

masklinn  committed 6bcdcb6

Fix various lint-ish warnings

  • Participants
  • Parent commits 7c9ac45

Comments (0)

Files changed (1)

     comparator('>'); comparator('>=');
     comparator('<>'); comparator('!='); comparator('==');
 
-    infix('|', 70); infix('^', 80), infix('&', 90);
+    infix('|', 70); infix('^', 80); infix('&', 90);
 
     infix('<<', 100); infix('>>', 100);
 
     infix('+', 110); infix('-', 110);
 
     infix('*', 120); infix('/', 120);
-    infix('//', 120), infix('%', 120);
+    infix('//', 120); infix('%', 120);
 
     prefix('-', 130); prefix('+', 130); prefix('~', 130);
 
         var PseudoToken = Whitespace + group(Number, Funny, ContStr, Name);
 
         return function tokenize(s) {
-            var max=s.length, tokens = [];
+            var max=s.length, tokens = [], start, end = undefined;
             // /g flag makes repeated exec() have memory
             var pseudoprog = new RegExp(PseudoToken, 'g');
 
                                     + '; parsed so far: ' + tokens);
                 }
 
-                var start = pseudomatch.index, end = pseudoprog.lastIndex;
+                start = pseudomatch.index;
+                end = pseudoprog.lastIndex;
                 // strip leading space caught by Whitespace
                 var token = s.slice(start, end).replace(new RegExp('^' + Whitespace), '');
                 var initial = token[0];
             return py.False;
         }
 
-        var fn = function () {}
+        var fn = function () {};
         fn.prototype = py.object;
         if (py.PY_isInstance(val, py.object)
             || py.PY_isSubclass(val, py.object)) {
         var args = argument[0];
         var kwargs = {};
         for (var k in argument[1]) {
+            if (!argument[1].hasOwnProperty(k)) { continue; }
             kwargs[k] = argument[1][k];
         }
         if (typeof format === 'string') {
                 "TypeError: unknown format specification " +
                     JSON.stringify(spec));
         };
+        var spec;
         // TODO: ensure all format arg names are actual names?
         for(var i=0; i<args.length; ++i) {
-            var spec = format[i];
+            spec = format[i];
             // spec list ended, or specs switching to keyword-only
             if (!spec || spec === '*') {
                 throw new Error(
             out[name(spec)] = args[i];
         }
         for(var j=i; j<format.length; ++j) {
-            var spec = format[j];
+            spec = format[j];
             var n = name(spec);
 
             if (n in out) {
         // Check that all required arguments have been matched, add
         // optional values
         for(var k = 0; k < format.length; ++k) {
-            var spec = format[k], n = name(spec);
+            spec = format[k];
+            var n = name(spec);
             // kwonly, va_arg or matched argument
             if (/^\*/.test(n) || n in out) { continue; }
             // Unmatched required argument
         if (callable.__is_type) {
             // class hack
             var instance = callable.__new__.call(callable, args, kwargs);
-            var typ = function () {}
+            var typ = function () {};
             typ.prototype = callable;
             if (instance instanceof typ) {
                 instance.__init__.call(instance, args, kwargs);
 
     // Builtins
     py.type = function type(name, bases, dict) {
-        var proto;
         if (typeof name !== 'string') {
             throw new Error("ValueError: a class name should be a string");
         }
             if (value === placeholder) {
                 this._value = 0; return;
             }
-            if (py.PYisInstance(value, py.float)) {
+            if (py.PY_isInstance(value, py.float)) {
                 this._value = value._value;
             }
             if (py.PY_isInstance(value, py.object) && '__float__' in value) {
         return expression();
     };
     var evaluate_operator = function (operator, a, b) {
-        var v;
         switch (operator) {
         case 'is': return a === b ? py.True : py.False;
         case 'is not': return a !== b ? py.True : py.False;