cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [29/38] js commit: [BlackBerry10] Fix Entry.moveTo check for valid success function
Date Tue, 14 May 2013 21:13:08 GMT
[BlackBerry10] Fix Entry.moveTo check for valid success function

Reviewed by Hasan Ahmad <haahmad@blackberry.com>


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/188c17d6
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/188c17d6
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/188c17d6

Branch: refs/heads/3.0.0
Commit: 188c17d64400770a1dcba7294aed38244aa1d811
Parents: 369e1af
Author: Bryan Higgins <bhiggins@blackberry.com>
Authored: Mon Apr 22 10:42:57 2013 -0400
Committer: Bryan Higgins <bhiggins@blackberry.com>
Committed: Fri May 3 09:50:05 2013 -0400

----------------------------------------------------------------------
 lib/blackberry10/plugin/Entry.js |   20 +++++++-------------
 1 files changed, 7 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/188c17d6/lib/blackberry10/plugin/Entry.js
----------------------------------------------------------------------
diff --git a/lib/blackberry10/plugin/Entry.js b/lib/blackberry10/plugin/Entry.js
index f80e879..cf971fe 100644
--- a/lib/blackberry10/plugin/Entry.js
+++ b/lib/blackberry10/plugin/Entry.js
@@ -50,20 +50,17 @@ Entry.prototype.setMetadata = function(successCallback, errorCallback,
metadataO
 
 Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallback) {
     argscheck.checkArgs('oSFF', 'Entry.moveTo', arguments);
-    var fail = errorCallback && function(code) {
-            errorCallback(new FileError(code));
-        },
-        srcPath = this.fullPath,
+    var srcPath = this.fullPath,
         name = newName || this.name,
         success = function(entry) {
             if (entry) {
-                if (successCallback === 'function') {
+                if (typeof successCallback === 'function') {
                     successCallback(fileUtils.createEntry(entry));
                 }
             }
             else {
-                if (typeof fail === 'function') {
-                    fail(FileError.NOT_FOUND_ERR);
+                if (typeof errorCallback === 'function') {
+                    errorCallback(new FileError(FileError.NOT_FOUND_ERR));
                 }
             }
         };
@@ -73,10 +70,7 @@ Entry.prototype.moveTo = function(parent, newName, successCallback, errorCallbac
 
 Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallback) {
     argscheck.checkArgs('oSFF', 'Entry.copyTo', arguments);
-    var fail = errorCallback && function(code) {
-            errorCallback(new FileError(code));
-        },
-        srcPath = this.fullPath,
+    var srcPath = this.fullPath,
         name = newName || this.name,
         success = function(entry) {
             if (entry) {
@@ -85,8 +79,8 @@ Entry.prototype.copyTo = function(parent, newName, successCallback, errorCallbac
                 }
             }
             else {
-                if (typeof fail === 'function') {
-                    fail(FileError.NOT_FOUND_ERR);
+                if (typeof errorCallback === 'function') {
+                    errorCallback(new FileError(FileError.NOT_FOUND_ERR));
                 }
             }
         };


Mime
View raw message