Updated Branches: refs/heads/master dd7ab2827 -> a5f0a62f9
jshinting... Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/a5f0a62f Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/a5f0a62f Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/a5f0a62f Branch: refs/heads/master Commit: a5f0a62f9a9dc5fd7af95ec3d09b6b17c0b89b44 Parents: dd7ab28 Author: Fil Maj <maj....@gmail.com> Authored: Mon May 7 16:18:51 2012 -0700 Committer: Fil Maj <maj....@gmail.com> Committed: Mon May 7 16:18:51 2012 -0700 ---------------------------------------------------------------------- lib/common/plugin/geolocation.js | 10 +++--- lib/common/utils.js | 60 ++++++++++++++++---------------- 2 files changed, 35 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/a5f0a62f/lib/common/plugin/geolocation.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/geolocation.js b/lib/common/plugin/geolocation.js index 1bee4f7..eef4382 100644 --- a/lib/common/plugin/geolocation.js +++ b/lib/common/plugin/geolocation.js @@ -110,16 +110,16 @@ var geolocation = { } else { if (options.timeout !== Infinity) { // If the timeout value was not set to Infinity (default), then - // set up a timeout function that will fire the error callback + // set up a timeout function that will fire the error callback // if no successful position was retrieved before timeout expired. timeoutTimer = createTimeout(fail, options.timeout); } else { // This is here so the check in the win function doesn't mess stuff up - // may seem weird but this guarantees timeoutTimer is + // may seem weird but this guarantees timeoutTimer is // always truthy before we call into native - timeoutTimer = true; + timeoutTimer = true; } - exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.maximumAge]); + exec(win, fail, "Geolocation", "getLocation", [options.enableHighAccuracy, options.maximumAge]); } return timeoutTimer; }, @@ -185,7 +185,7 @@ var geolocation = { if (id && timers[id] !== undefined) { clearTimeout(timers[id]); delete timers[id]; - exec(null, null, "Geolocation", "clearWatch", [id]); + exec(null, null, "Geolocation", "clearWatch", [id]); } } }; http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/a5f0a62f/lib/common/utils.js ---------------------------------------------------------------------- diff --git a/lib/common/utils.js b/lib/common/utils.js index c5bff13..30393f2 100644 --- a/lib/common/utils.js +++ b/lib/common/utils.js @@ -1,18 +1,18 @@ -var utils = exports +var utils = exports; /** * Returns an indication of whether the argument is an array or not */ utils.isArray = function(a) { return Object.prototype.toString.call(a) == '[object Array]'; -} +}; /** * Returns an indication of whether the argument is a Date or not */ utils.isDate = function(d) { return Object.prototype.toString.call(d) == '[object Date]'; -} +}; /** * Does a deep clone of the object. @@ -39,7 +39,7 @@ utils.clone = function(obj) { } } return retVal; -} +}; /** * Returns a wrappered version of the function @@ -54,7 +54,7 @@ utils.close = function(context, func, params) { return func.apply(context, params); }; } -} +}; /** * Create a UUID @@ -65,7 +65,7 @@ utils.createUUID = function() { UUIDcreatePart(2) + '-' + UUIDcreatePart(2) + '-' + UUIDcreatePart(6); -} +}; /** * Extends a child object from a parent object using classical inheritance @@ -81,7 +81,7 @@ utils.extend = (function() { Child.__super__ = Parent.prototype; Child.prototype.constructor = Child; }; -}()) +}()); /** * Alerts a message in any available way: alert or console.log. @@ -92,7 +92,7 @@ utils.alert = function(msg) { } else if (console && console.log) { console.log(msg); } -} +}; /** * Formats a string and arguments following it ala sprintf() @@ -109,37 +109,37 @@ utils.alert = function(msg) { * http://getfirebug.com/wiki/index.php/Console_API */ utils.format = function(formatString /* ,... */) { - if (formatString == null) return "" - if (arguments.length == 1) return formatString.toString() + if (formatString === null || formatString === undefined) return ""; + if (arguments.length == 1) return formatString.toString(); - var pattern = /(.*?)%(.)(.*)/ - var rest = formatString.toString() - var result = [] - var args = [].slice.call(arguments,1) + var pattern = /(.*?)%(.)(.*)/; + var rest = formatString.toString(); + var result = []; + var args = [].slice.call(arguments,1); while (args.length) { - var arg = args.shift() - var match = pattern.exec(rest) + var arg = args.shift(); + var match = pattern.exec(rest); - if (!match) break + if (!match) break; - rest = match[3] + rest = match[3]; - result.push(match[1]) + result.push(match[1]); if (match[2] == '%') { - result.push('%') - args.unshift(arg) - continue + result.push('%'); + args.unshift(arg); + continue; } - result.push(formatted(arg, match[2])) + result.push(formatted(arg, match[2])); } - result.push(rest) + result.push(rest); - return result.join('') -} + return result.join(''); +}; //------------------------------------------------------------------------------ function UUIDcreatePart(length) { @@ -159,11 +159,11 @@ function formatted(object, formatChar) { switch(formatChar) { case 'j': - case 'o': return JSON.stringify(object) - case 'c': return '' + case 'o': return JSON.stringify(object); + case 'c': return ''; } - if (null == object) return Object.prototype.toString.call(object) + if (null === object) return Object.prototype.toString.call(object); - return object.toString() + return object.toString(); }