Updated Branches: refs/heads/master b9f5ebd4f -> ea4e98bbd
[all] Minor simplification of CompassHeading.js's ctor logic. Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/ea4e98bb Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/ea4e98bb Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/ea4e98bb Branch: refs/heads/master Commit: ea4e98bbd4a2378891b25f1e4c59e2f88d81a441 Parents: b9f5ebd Author: Andrew Grieve <[email protected]> Authored: Fri Dec 14 15:18:02 2012 -0500 Committer: Andrew Grieve <[email protected]> Committed: Thu Jan 10 09:33:40 2013 -0500 ---------------------------------------------------------------------- lib/common/plugin/CompassHeading.js | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/ea4e98bb/lib/common/plugin/CompassHeading.js ---------------------------------------------------------------------- diff --git a/lib/common/plugin/CompassHeading.js b/lib/common/plugin/CompassHeading.js index 61e663d..09d0fae 100644 --- a/lib/common/plugin/CompassHeading.js +++ b/lib/common/plugin/CompassHeading.js @@ -20,10 +20,10 @@ */ var CompassHeading = function(magneticHeading, trueHeading, headingAccuracy, timestamp) { - this.magneticHeading = (magneticHeading !== undefined ? magneticHeading : null); - this.trueHeading = (trueHeading !== undefined ? trueHeading : null); - this.headingAccuracy = (headingAccuracy !== undefined ? headingAccuracy : null); - this.timestamp = (timestamp !== undefined ? timestamp : new Date().getTime()); + this.magneticHeading = magneticHeading || null; + this.trueHeading = trueHeading || null; + this.headingAccuracy = headingAccuracy || null; + this.timestamp = timestamp || new Date().getTime(); }; module.exports = CompassHeading;
