Skip to content

Commit

Permalink
do not throw an exception when calling lstat on non-symbolic files [c…
Browse files Browse the repository at this point in the history
…loses #14]
  • Loading branch information
davidkudera committed Jun 20, 2015
1 parent ad9b62a commit ae17fee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -700,10 +700,6 @@

stats = this._data[path].stats;

if (!stats.isSymbolicLink()) {
Errors.notSymlink(path);
}

return stats;
};

Expand Down
7 changes: 3 additions & 4 deletions test/fs.posix.js
Original file line number Diff line number Diff line change
Expand Up @@ -395,11 +395,10 @@
});
});

it('should return an error if path is not a symlink', function (done) {
it('should return for regular file', function (done) {
fs.mkdirSync('/var/www');
fs.lstat('/var/www', function (err) {
expect(err).to.be.an.instanceof(Error);
expect(err.message).to.be.equal("Path '/var/www' is not a symbolic link.");
fs.lstat('/var/www', function (err, stats) {
expect(stats.isDirectory()).to.be.true;
done();
});
});
Expand Down

0 comments on commit ae17fee

Please sign in to comment.