tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
911 stars 86 forks source link

Update fs.stat(), fs.lstat(), and fs.fstat() for Node 7.7+ (fixes #197) #198

Closed not-an-aardvark closed 7 years ago

not-an-aardvark commented 7 years ago

Node 7.7 changed the behavior of the binding.{stat,lstat,fstat} functions (see https://github.com/nodejs/node/pull/11522). This updates the binding functions used in mock-fs to match the new Node binding behavior, while still maintaining compatibility with old Node versions. The new behavior is detected when the second argument to binding.{stat,lstat,fstat} is a Float64Array, which would be an invalid argument for previous versions of the binding.

This commit does not add any tests because the existing tests were already broken by the Node update. Given that they're passing now, I think the behavior is already covered, but let me know if there are any tests I should add.

tschaub commented 7 years ago

Thanks for the fix @not-an-aardvark!