diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-16 12:09:44 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2013-04-18 20:08:30 +0300 |
commit | 63df46540d7ba78dca88fd83ec0def3bd203b638 (patch) | |
tree | 88015ec7e7c9b642563556786edd141dec3e5179 | |
parent | a0406a1cb9d0de51c923fca1c1e2e637dd3bd57a (diff) |
Clean up jslint diagnostics.
-rwxr-xr-x | src/embind/embind.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/embind/embind.js b/src/embind/embind.js index 0af19bb1..bf493bf9 100755 --- a/src/embind/embind.js +++ b/src/embind/embind.js @@ -479,7 +479,7 @@ function new_(constructor, argumentList) { var r = constructor.apply(obj, argumentList); return (r instanceof Object) ? r : obj; -}; +} // The path to interop from JS code to C++ code: // (hand-written JS code) -> (autogenerated JS invoker) -> (template-generated C++ invoker) -> (target C++ function) @@ -512,8 +512,8 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp // } var argsList = ""; - for(i = 0; i < argCount-2; ++i) { - argsList += (i!=0?", ":"")+"arg"+i; + for(var i = 0; i < argCount-2; ++i) { + argsList += (i!==0?", ":"")+"arg"+i; } var invokerFnBody = @@ -527,7 +527,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp // TODO: Remove this completely once all function invokers are being dynamically generated. var needsDestructorStack = false; - for(i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. + for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack needsDestructorStack = true; break; @@ -543,7 +543,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp var args1 = ["throwBindingError", "validateThis", "classType", "invoker", "fn", "runDestructors", "retType", "classParam"]; var args2 = [throwBindingError, validateThis, classType, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]]; - for(i = 0; i < argCount-2; ++i) { + for(var i = 0; i < argCount-2; ++i) { invokerFnBody += "var arg"+i+" = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n"; // argsList += ", arg"+i; args1.push("argType"+i); @@ -551,7 +551,7 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp } if (isClassMethodFunc) { - invokerFnBody += "var thisWired = classParam.toWireType("+dtorStack+", this);\n" + invokerFnBody += "var thisWired = classParam.toWireType("+dtorStack+", this);\n"; argsList = "thisWired" + (argsList.length > 0 ? ", " : "") + argsList; } @@ -563,8 +563,8 @@ function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cp if (needsDestructorStack) { invokerFnBody += "runDestructors(destructors);\n"; } else { - for(i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. - var paramName = (i == 1 ? "thisWired" : ("argType"+(i-2))); + for(var i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method. + var paramName = (i === 1 ? "thisWired" : ("argType"+(i-2))); if (argTypes[i].destructorFunction !== null) { invokerFnBody += paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n"; args1.push(paramName+"_dtor"); @@ -788,7 +788,7 @@ function __embind_finalize_struct(structType) { }); } -genericPointerToWireType = function(destructors, handle) { +var genericPointerToWireType = function(destructors, handle) { var self = this; function throwCannotConvert() { var name; @@ -871,7 +871,7 @@ genericPointerToWireType = function(destructors, handle) { return ptr; }; -nonConstNoSmartPtrRawPointerToWireType = function(destructors, handle) { +var nonConstNoSmartPtrRawPointerToWireType = function(destructors, handle) { if (handle === null) { if (this.isReference) { throwBindingError('null is not a valid ' + this.name); @@ -889,7 +889,7 @@ nonConstNoSmartPtrRawPointerToWireType = function(destructors, handle) { return ptr; }; -constNoSmartPtrRawPointerToWireType = function(destructors, handle) { +var constNoSmartPtrRawPointerToWireType = function(destructors, handle) { if (handle === null) { if (this.isReference) { throwBindingError('null is not a valid ' + this.name); |