You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2012/02/23 18:53:19 UTC

[32/35] git commit: cleaning up require syntax use in File API

cleaning up require syntax use in File API


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/0fc2b1ac
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/0fc2b1ac
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/0fc2b1ac

Branch: refs/heads/ios
Commit: 0fc2b1acbd0502bf148bee57b3ad4450a7834641
Parents: f26e2a6
Author: Fil Maj <fi...@nitobi.com>
Authored: Wed Feb 15 17:29:50 2012 -0800
Committer: Fil Maj <fi...@nitobi.com>
Committed: Wed Feb 15 17:29:50 2012 -0800

----------------------------------------------------------------------
 lib/plugin/FileSystem.js        |    6 +++++-
 lib/plugin/requestFileSystem.js |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/0fc2b1ac/lib/plugin/FileSystem.js
----------------------------------------------------------------------
diff --git a/lib/plugin/FileSystem.js b/lib/plugin/FileSystem.js
index c884065..c4c3f84 100644
--- a/lib/plugin/FileSystem.js
+++ b/lib/plugin/FileSystem.js
@@ -1,3 +1,5 @@
+var DirectoryEntry = require('cordova/plugin/DirectoryEntry');
+
 /**
  * An interface representing a file system
  *
@@ -7,7 +9,9 @@
  */
 var FileSystem = function(name, root) {
     this.name = name || null;
-    this.root = root || null;
+    if (root) {
+        this.root = new DirectoryEntry(name, root);
+    }
 };
 
 module.exports = FileSystem;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/0fc2b1ac/lib/plugin/requestFileSystem.js
----------------------------------------------------------------------
diff --git a/lib/plugin/requestFileSystem.js b/lib/plugin/requestFileSystem.js
index 1dd9443..3fa1f70 100644
--- a/lib/plugin/requestFileSystem.js
+++ b/lib/plugin/requestFileSystem.js
@@ -19,7 +19,7 @@ var requestFileSystem = function(type, size, successCallback, errorCallback) {
     var success = function(file_system) {
       if (file_system) {
         // 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));
+        var result = new FileSystem(file_system.name, file_system.root);
         successCallback(result);
       } 
       else {