incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim...@apache.org
Subject [20/48] js commit: should error on reading a directory that doesn't exist
Date Thu, 07 Jun 2012 20:40:44 GMT
should error on reading a directory that doesn't exist


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

Branch: refs/heads/master
Commit: 9cc8237df9661811c9659cf4633aa81beb340103
Parents: 29dd29b
Author: Tim Kim <tim.kim@nitobi.com>
Authored: Wed May 30 16:44:47 2012 -0700
Committer: Tim Kim <tim.kim@nitobi.com>
Committed: Thu Jun 7 13:40:23 2012 -0700

----------------------------------------------------------------------
 lib/playbook/plugin/playbook/DirectoryReader.js |   25 ++++++++++--------
 1 files changed, 14 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/9cc8237d/lib/playbook/plugin/playbook/DirectoryReader.js
----------------------------------------------------------------------
diff --git a/lib/playbook/plugin/playbook/DirectoryReader.js b/lib/playbook/plugin/playbook/DirectoryReader.js
index 2508be4..9ef8233 100644
--- a/lib/playbook/plugin/playbook/DirectoryReader.js
+++ b/lib/playbook/plugin/playbook/DirectoryReader.js
@@ -36,16 +36,16 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
         errorCallback(new FileError(code));
     };
 
-       var theEntries = [];
+    var theEntries = [];
 
-       var anEntry = function(isDirectory, name, fullPath){
-           this.isDirectory = (isDirectory ? true : false),
-           this.isFile = (isDirectory ? false : true),
-           this.name = name,
-           this.fullPath = fullPath
-       };
+    var anEntry = function(isDirectory, name, fullPath){
+        this.isDirectory = (isDirectory ? true : false),
+        this.isFile = (isDirectory ? false : true),
+        this.name = name,
+        this.fullPath = fullPath
+    };
 
-       if(blackberry.io.dir.exists(this.path)){
+    if(blackberry.io.dir.exists(this.path)){
 
         var theDirectories = blackberry.io.dir.listDirectories(this.path)
         var theFiles = blackberry.io.dir.listFiles(this.path);
@@ -59,9 +59,12 @@ DirectoryReader.prototype.readEntries = function(successCallback, errorCallback)
         for(var j=0;j<theFilesLength;j++){
             theEntries.push(new anEntry(false, theFiles[j], this.path+theFiles[j]));
         }
-       }
-       console.log(theEntries);
-       win(theEntries);
+        win(theEntries);
+    }else{
+        fail(FileError.NOT_FOUND_ERR);
+    }
+
+
 };
 
 module.exports = DirectoryReader;


Mime
View raw message