mirror of
https://github.com/jsdoc/jsdoc.git
synced 2025-12-08 19:46:11 +00:00
more fs module stubs
This commit is contained in:
parent
ac11bb6e53
commit
cc238c1701
32
rhino/fs.js
32
rhino/fs.js
@ -47,16 +47,24 @@ var statSync = exports.statSync = function statSync(_path) {
|
||||
}
|
||||
|
||||
return {
|
||||
isFile: function() {
|
||||
isFile: function isFile() {
|
||||
return f.isFile();
|
||||
},
|
||||
isDirectory: function() {
|
||||
isDirectory: function isDirectory() {
|
||||
return f.isDirectory();
|
||||
},
|
||||
isSymlink: function isSymlink() {
|
||||
// java.io.File resolves symlinks
|
||||
return false;
|
||||
}
|
||||
};
|
||||
};
|
||||
exports.stat = asyncify(statSync);
|
||||
|
||||
// java.io.File resolves symlinks, so we can alias `lstat` to `stat`
|
||||
var lstatSync = exports.lstatSync = statSync;
|
||||
exports.lstat = asyncify(lstatSync);
|
||||
|
||||
var readdirSync = exports.readdirSync = function readdirSync(_path) {
|
||||
var dir;
|
||||
var files;
|
||||
@ -66,12 +74,10 @@ var readdirSync = exports.readdirSync = function readdirSync(_path) {
|
||||
throw errorFactory(_path);
|
||||
}
|
||||
|
||||
files = dir.list();
|
||||
|
||||
// Convert files to Javascript strings so they play nice with node modules
|
||||
files = files.map(function(fileName) {
|
||||
return String(fileName);
|
||||
});
|
||||
files = dir.list()
|
||||
.map(function(fileName) {
|
||||
return String(fileName);
|
||||
});
|
||||
|
||||
return files;
|
||||
};
|
||||
@ -146,3 +152,13 @@ exports.writeFileSync = function writeFileSync(filename, data, encoding) {
|
||||
}
|
||||
};
|
||||
exports.writeFile = asyncify(exports.writeFileSync);
|
||||
|
||||
exports.rmdirSync = function rmdirSync(_path) {
|
||||
throw new Error('not implemented');
|
||||
};
|
||||
exports.rmdir = asyncify(exports.rmdirSync);
|
||||
|
||||
exports.unlinkSync = function unlinkSync(_path) {
|
||||
throw new Error('not implemented');
|
||||
};
|
||||
exports.unlink = asyncify(exports.unlinkSync);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user