You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/03/04 16:19:53 UTC

git commit: CB-6119 Fix `plugman info` command printing "undefined" always

Repository: cordova-plugman
Updated Branches:
  refs/heads/master 76a445f3f -> 62be35690


CB-6119 Fix `plugman info` command printing "undefined" always


Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/62be3569
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/62be3569
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/62be3569

Branch: refs/heads/master
Commit: 62be35690f2d088f4faad5bbd2fc6a735efd0f19
Parents: 76a445f
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Mar 4 10:12:04 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Mar 4 10:19:25 2014 -0500

----------------------------------------------------------------------
 plugman.js            | 2 +-
 spec/wrappers.spec.js | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/62be3569/plugman.js
----------------------------------------------------------------------
diff --git a/plugman.js b/plugman.js
index c2f3255..5ceac60 100644
--- a/plugman.js
+++ b/plugman.js
@@ -32,7 +32,7 @@ function addProperty(o, symbol, modulePath, doWrap) {
                 // If args exist and the last one is a function, it's the callback.
                 var args = Array.prototype.slice.call(arguments);
                 var cb = args.pop();
-                val.apply(o, args).done(cb, cb);
+                val.apply(o, args).done(function(result) {cb(undefined, result)}, cb);
             } else {
                 val.apply(o, arguments).done(null, function(err){ throw err; });
             }

http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/62be3569/spec/wrappers.spec.js
----------------------------------------------------------------------
diff --git a/spec/wrappers.spec.js b/spec/wrappers.spec.js
index 4b64acd..bec747b 100644
--- a/spec/wrappers.spec.js
+++ b/spec/wrappers.spec.js
@@ -19,7 +19,7 @@ describe('callback wrapper', function() {
             });
 
             it('should call the callback on success', function(done) {
-                raw.andReturn(Q());
+                raw.andReturn(Q(1));
                 plugman[call](function(err) {
                     expect(err).toBeUndefined();
                     done();
@@ -27,7 +27,7 @@ describe('callback wrapper', function() {
             });
 
             it('should call the callback with the error on failure', function(done) {
-                raw.andReturn(Q.reject(new Error('junk')));
+                raw.andCallFake(function() { return Q.reject(new Error('junk'))});
                 plugman[call](function(err) {
                     expect(err).toEqual(new Error('junk'));
                     done();