cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kam...@apache.org
Subject [2/2] cordova-lib git commit: CB-8754 Addressed comments:
Date Fri, 27 Mar 2015 15:16:35 GMT
CB-8754 Addressed comments:

* npm-helper.restoreSettings() should be called in a finally() rather than a
  then().

* Ensure immediate return from registry.initSettings() honors
  returnEmptySettings arg.

GitHub: close #194


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/979f499b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/979f499b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/979f499b

Branch: refs/heads/master
Commit: 979f499b1bd8eb9cc51d3dd23cd128b14a9f9d08
Parents: 4ad1b3d
Author: Tim Barham <tim.barham@microsoft.com>
Authored: Sat Mar 28 00:42:56 2015 +1000
Committer: Mark Koudritsky <kamrik@gmail.com>
Committed: Fri Mar 27 11:10:58 2015 -0400

----------------------------------------------------------------------
 cordova-lib/src/plugman/registry/registry.js | 2 +-
 cordova-lib/src/util/npm-helper.js           | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/979f499b/cordova-lib/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/registry/registry.js b/cordova-lib/src/plugman/registry/registry.js
index 1bd8c3e..71810a3 100644
--- a/cordova-lib/src/plugman/registry/registry.js
+++ b/cordova-lib/src/plugman/registry/registry.js
@@ -216,7 +216,7 @@ function initSettings(returnEmptySettings) {
 
     // check if settings already set
     if(settings !== null) {
-        return Q(settings);
+        return Q(returnEmptySettings ? {} : settings);
     }
 
     // setting up settings

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/979f499b/cordova-lib/src/util/npm-helper.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/util/npm-helper.js b/cordova-lib/src/util/npm-helper.js
index 01b370b..c4a2c56 100644
--- a/cordova-lib/src/util/npm-helper.js
+++ b/cordova-lib/src/util/npm-helper.js
@@ -32,7 +32,7 @@ var npm = require('npm'),
  * @param {Function} promiseChain
  */
 function loadWithSettingsThenRestore(settings, promiseChain) {
-    return loadWithSettings(settings).then(promiseChain).then(restoreSettings);
+    return loadWithSettings(settings).then(promiseChain).finally(restoreSettings);
 }
 
 function loadWithSettings(settings) {
@@ -58,7 +58,7 @@ function loadWithSettings(settings) {
     });
 }
 
-function restoreSettings(passthrough) {
+function restoreSettings() {
     if (cachedSettings) {
         cachedSettings.forEach(function (prop) {
             if (prop in cachedSettingsValues) {
@@ -70,7 +70,6 @@ function restoreSettings(passthrough) {
         cachedSettings = null;
         cachedSettingsValues = null;
     }
-    return passthrough;
 }
 
 module.exports.loadWithSettingsThenRestore = loadWithSettingsThenRestore;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message