Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't call fs functions when they are unbound #11

Closed
eugirdor opened this issue Jun 11, 2015 · 1 comment
Closed

Can't call fs functions when they are unbound #11

eugirdor opened this issue Jun 11, 2015 · 1 comment

Comments

@eugirdor
Copy link
Contributor

When using the standard fs module, the follow will work:

var fs = require('fs');
var stat = fs.stat;
stat('/var/www', function (err, stats) {
})

However, when using fs-mock, an error will get thrown because the method loses its context and most of the methods make use of this.

I believe the fix would be to change the thin arrows -> on the fs methods in fs.coffee to be fat arrows => so that they stay bound to the correct object.

@davidkudera
Copy link
Member

Hi and thanks for writing that issue. This should be solved in next version which will be writen in pure javascript. Unfortenately I don't have any free time right now, so hopefuly next week..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants