You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dp...@apache.org on 2018/08/26 18:11:46 UTC

[cordova-lib] 04/04: Reduce usage of Q-specific methods

This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-lib.git

commit a35059cae65552d1d9d12d6d58d1faa66ca65a0a
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Fri Jun 22 01:29:31 2018 +0200

    Reduce usage of Q-specific methods
---
 .../fixtures/projects/platformApi/platforms/windows/cordova/Api.js    | 4 ++--
 spec/plugman/install.spec.js                                          | 2 +-
 src/cordova/platform/check.js                                         | 2 +-
 src/cordova/plugin/add.js                                             | 2 +-
 src/plugman/install.js                                                | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/spec/cordova/fixtures/projects/platformApi/platforms/windows/cordova/Api.js b/spec/cordova/fixtures/projects/platformApi/platforms/windows/cordova/Api.js
index 125e3c5..9d9a279 100644
--- a/spec/cordova/fixtures/projects/platformApi/platforms/windows/cordova/Api.js
+++ b/spec/cordova/fixtures/projects/platformApi/platforms/windows/cordova/Api.js
@@ -224,7 +224,7 @@ Api.prototype.addPlugin = function (plugin, installOptions) {
         })
         // CB-11022 return non-falsy value to indicate
         // that there is no need to run prepare after
-        .thenResolve(true);
+        .then(_ => true);
 };
 
 /**
@@ -261,7 +261,7 @@ Api.prototype.removePlugin = function (plugin, uninstallOptions) {
         })
         // CB-11022 return non-falsy value to indicate
         // that there is no need to run prepare after
-        .thenResolve(true);
+        .then(_ => true);
 };
 
 /**
diff --git a/spec/plugman/install.spec.js b/spec/plugman/install.spec.js
index d458a14..bfe4641 100644
--- a/spec/plugman/install.spec.js
+++ b/spec/plugman/install.spec.js
@@ -136,7 +136,7 @@ describe('plugman install start', function () {
         var addPluginOrig = api.addPlugin;
         spyOn(api, 'addPlugin').and.callFake(function () {
             return addPluginOrig.apply(api, arguments)
-                .thenResolve(returnValues[returnValueIndex++]);
+                .then(_ => returnValues[returnValueIndex++]);
         });
 
         return install('android', project, plugins['org.test.plugins.dummyplugin'])
diff --git a/src/cordova/platform/check.js b/src/cordova/platform/check.js
index e190f37..ff94c5f 100644
--- a/src/cordova/platform/check.js
+++ b/src/cordova/platform/check.js
@@ -92,7 +92,7 @@ function check (hooksRunner, projectRoot) {
                         d_cur.resolve('broken');
                     });
 
-                Q.all([d_avail.promise, d_cur.promise]).spread(function (avail, v) {
+                Q.all([d_avail.promise, d_cur.promise]).then(([avail, v]) => {
                     var m;
                     var prefix = p + ' @ ' + (v || 'unknown');
                     switch (avail) {
diff --git a/src/cordova/plugin/add.js b/src/cordova/plugin/add.js
index e674e5d..552ca8a 100644
--- a/src/cordova/plugin/add.js
+++ b/src/cordova/plugin/add.js
@@ -134,7 +134,7 @@ function add (projectRoot, hooksRunner, opts) {
                                 if (!didPrepare) shouldRunPrepare = true;
                             });
                     })
-                        .thenResolve(pluginInfo);
+                        .then(_ => pluginInfo);
                 }).then(function (pluginInfo) {
                     var pkgJson;
                     var pkgJsonPath = path.join(projectRoot, 'package.json');
diff --git a/src/plugman/install.js b/src/plugman/install.js
index 8e67bea..b564dc0 100644
--- a/src/plugman/install.js
+++ b/src/plugman/install.js
@@ -358,7 +358,7 @@ function runInstall (actions, platform, project_dir, plugin_dir, plugins_dir, op
                 }).then(function (installResult) {
                     return hooksRunner.fire('after_plugin_install', hookOptions)
                         // CB-11022 Propagate install result to caller to be able to avoid unnecessary prepare
-                        .thenResolve(installResult);
+                        .then(_ => installResult);
                 });
             } else {
                 return handleInstall(actions, pluginInfo, platform, project_dir, plugins_dir, install_plugin_dir, filtered_variables, options);


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