incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [35/35] git commit: tweaking FileError constructor so you can pass in error code
Date Thu, 23 Feb 2012 17:53:19 GMT
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 <filip.maj@nitobi.com>
Authored: Wed Feb 15 15:25:36 2012 -0800
Committer: Fil Maj <filip.maj@nitobi.com>
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 {


Mime
View raw message