You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ka...@apache.org on 2015/03/27 16:16:35 UTC

[2/2] cordova-lib git commit: CB-8754 Addressed comments:

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 <ti...@microsoft.com>
Authored: Sat Mar 28 00:42:56 2015 +1000
Committer: Mark Koudritsky <ka...@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