Return-Path: X-Original-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 292AD9DE1 for ; Mon, 2 Apr 2012 14:51:32 +0000 (UTC) Received: (qmail 77687 invoked by uid 500); 2 Apr 2012 14:51:32 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 77669 invoked by uid 500); 2 Apr 2012 14:51:32 -0000 Mailing-List: contact callback-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-commits@incubator.apache.org Received: (qmail 77645 invoked by uid 99); 2 Apr 2012 14:51:32 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2012 14:51:32 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B83C3A733; Mon, 2 Apr 2012 14:51:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: macdonst@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: git commit: CB-421 - FileAPI: getParent() does not return a valid DirectoryEntry Message-Id: <20120402145131.B83C3A733@tyr.zones.apache.org> Date: Mon, 2 Apr 2012 14:51:31 +0000 (UTC) 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 Authored: Mon Apr 2 10:48:11 2012 -0400 Committer: macdonst 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;