incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject git commit: CB-421 - FileAPI: getParent() does not return a valid DirectoryEntry
Date Mon, 02 Apr 2012 14:51:31 GMT
Updated Branches:
  refs/heads/master e49628efb -> 4e4e11798


CB-421 - FileAPI: getParent() does not return a valid DirectoryEntry


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

Branch: refs/heads/master
Commit: 4e4e117988d84ca0b2c14451fa105c53a60f1b8d
Parents: e49628e
Author: macdonst <simon.macdonald@gmail.com>
Authored: Mon Apr 2 10:48:11 2012 -0400
Committer: macdonst <simon.macdonald@gmail.com>
Committed: Mon Apr 2 10:48:11 2012 -0400

----------------------------------------------------------------------
 lib/common/plugin/Entry.js |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/4e4e1179/lib/common/plugin/Entry.js
----------------------------------------------------------------------
diff --git a/lib/common/plugin/Entry.js b/lib/common/plugin/Entry.js
index f748dcc..157518f 100644
--- a/lib/common/plugin/Entry.js
+++ b/lib/common/plugin/Entry.js
@@ -189,10 +189,15 @@ Entry.prototype.remove = function(successCallback, errorCallback) {
  * @param errorCallback {Function} called with a FileError
  */
 Entry.prototype.getParent = function(successCallback, errorCallback) {
+    var win = typeof successCallback !== 'function' ? null : function(result) {
+        var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
+        var entry = new DirectoryEntry(result.name, result.fullPath);
+        successCallback(entry);
+    };
     var fail = typeof errorCallback !== 'function' ? null : function(code) {
         errorCallback(new FileError(code));
     };
-    exec(successCallback, fail, "File", "getParent", [this.fullPath]);
+    exec(win, fail, "File", "getParent", [this.fullPath]);
 };
 
 module.exports = Entry;


Mime
View raw message