Closed bcheidemann closed 3 years ago
I've created a PR with a failing regression test to illustrate the issue ( PR #774 )
Nice find. I think this is a bug in validate_file_options()
, or how we deal with the encoding being missing on the options
object:
We are returning back the options
object untouched, which is probably OK (node does the same), but we fail to then use 'utf8'
as our default, like node does in https://github.com/nodejs/node/blob/24fd791184ad0ba27f92ac49b820aec78e491296/lib/fs.js#L1512. I'll comment more in the PR.
Thanks for the pointer - saved me a lot of time!
Fixed by #774.
The following code:
Throws the error:
Error: Uncaught TypeError: buffer.copy is not a function (http://localhost:1234/tests.e31bb0bc.js:17358) at commonjsGlobal.onerror (mocha.947ba722.js:32655:12)
There are some more examples of issues like this but I don't have them to hand at present. I will add them to this bug report when I am able to.
EDIT: I found one similar(ish) issue with fs.readdir. I've opened a separate issue (#775) for this as it appears to be an unrelated issue on initial inspection.