Browse files

Fix statSync for rhino

  • Loading branch information...
1 parent 4165586 commit a2d612f400f8cd61ffd95c81a01512d856b4c300 @kriszyp committed Nov 16, 2011
Showing with 8 additions and 19 deletions.
  1. +8 −19 engines/rhino/fs.js
View
27 engines/rhino/fs.js
@@ -10,30 +10,19 @@ exports.writeFileSync = File.write;
exports.mkdirSync = File.mkdir;
exports.readdir = exports.list;
exports.stat = exports.statSync = function(path) {
- return {
- isFile: function(){
- return File.isFile(path);
- },
- size: File.size(path)
- };
-
- /*try{
- var stat = File.stat.apply(null, arguments);
+ try{
+ return {
+ isFile: function(){
+ return File.isFile(path);
+ },
+ size: File.size(path)
+ };
}catch(e){
var deferred = defer();
deferred.reject(e);
return deferred.promise;
}
- stat.isFile = function() {
- return File.isFile(path);
- }
- if(!stat.mtime){
- var deferred = defer();
- deferred.reject("File not found");
- return deferred.promise;
- }
- return stat;*/
-}
+};
exports.makeTree = File.mkdirs;
exports.makeDirectory = File.mkdir;

0 comments on commit a2d612f

Please sign in to comment.