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 AE5D49B82 for ; Thu, 23 Feb 2012 17:54:27 +0000 (UTC) Received: (qmail 5522 invoked by uid 500); 23 Feb 2012 17:54:27 -0000 Delivered-To: apmail-incubator-callback-commits-archive@incubator.apache.org Received: (qmail 5503 invoked by uid 500); 23 Feb 2012 17:54:27 -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 5496 invoked by uid 99); 23 Feb 2012 17:54:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2012 17:54:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.114] (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2012 17:54:25 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 616828127FB; Thu, 23 Feb 2012 17:53:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: filmaj@apache.org To: callback-commits@incubator.apache.org X-Mailer: ASF-Git Admin Mailer Subject: [35/35] git commit: tweaking FileError constructor so you can pass in error code Message-Id: <20120223175319.616828127FB@tyr.zones.apache.org> Date: Thu, 23 Feb 2012 17:53:19 +0000 (UTC) X-Virus-Checked: Checked by ClamAV on apache.org tweaking FileError constructor so you can pass in error code 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/4c5cadd5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/4c5cadd5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/4c5cadd5 Branch: refs/heads/ios Commit: 4c5cadd5bca6877ef6a8c514eecac827d2c06344 Parents: b99961d Author: Fil Maj Authored: Wed Feb 15 15:25:36 2012 -0800 Committer: Fil Maj Committed: Wed Feb 15 15:25:36 2012 -0800 ---------------------------------------------------------------------- lib/plugin/FileError.js | 4 ++-- lib/plugin/requestFileSystem.js | 11 +++-------- 2 files changed, 5 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/4c5cadd5/lib/plugin/FileError.js ---------------------------------------------------------------------- diff --git a/lib/plugin/FileError.js b/lib/plugin/FileError.js index 70e2752..f61c092 100644 --- a/lib/plugin/FileError.js +++ b/lib/plugin/FileError.js @@ -1,8 +1,8 @@ /** * FileError */ -function FileError() { - this.code = null; +function FileError(error) { + this.code = error || null; } // File error codes http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/4c5cadd5/lib/plugin/requestFileSystem.js ---------------------------------------------------------------------- diff --git a/lib/plugin/requestFileSystem.js b/lib/plugin/requestFileSystem.js index a29edb0..1dd9443 100644 --- a/lib/plugin/requestFileSystem.js +++ b/lib/plugin/requestFileSystem.js @@ -1,4 +1,5 @@ var FileError = require('cordova/plugin/FileError'), + FileSystem = require('cordova/plugin/FileSystem'), exec = require('cordova/exec'); /** @@ -16,15 +17,9 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) { } else { // if successful, return a FileSystem object var success = function(file_system) { - var result; if (file_system) { - // grab the name from the file system object - result = { - name: file_system.name || null - }; - - // create Entry object from file system root - result.root = new require('cordova/plugin/DirectoryEntry')(file_system.root); + // grab the name and root from the file system object + var result = new FileSystem(file_system.name || null, (typeof file_system.root != 'undefined'?new require('cordova/plugin/DirectoryEntry')(file_system.root):null)); successCallback(result); } else {