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
28
rhino/fs.js
28
rhino/fs.js
@ -47,16 +47,24 @@ var statSync = exports.statSync = function statSync(_path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isFile: function() {
|
isFile: function isFile() {
|
||||||
return f.isFile();
|
return f.isFile();
|
||||||
},
|
},
|
||||||
isDirectory: function() {
|
isDirectory: function isDirectory() {
|
||||||
return f.isDirectory();
|
return f.isDirectory();
|
||||||
|
},
|
||||||
|
isSymlink: function isSymlink() {
|
||||||
|
// java.io.File resolves symlinks
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
exports.stat = asyncify(statSync);
|
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 readdirSync = exports.readdirSync = function readdirSync(_path) {
|
||||||
var dir;
|
var dir;
|
||||||
var files;
|
var files;
|
||||||
@ -66,10 +74,8 @@ var readdirSync = exports.readdirSync = function readdirSync(_path) {
|
|||||||
throw errorFactory(_path);
|
throw errorFactory(_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
files = dir.list();
|
files = dir.list()
|
||||||
|
.map(function(fileName) {
|
||||||
// Convert files to Javascript strings so they play nice with node modules
|
|
||||||
files = files.map(function(fileName) {
|
|
||||||
return String(fileName);
|
return String(fileName);
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -146,3 +152,13 @@ exports.writeFileSync = function writeFileSync(filename, data, encoding) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
exports.writeFile = asyncify(exports.writeFileSync);
|
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