node icon indicating copy to clipboard operation
node copied to clipboard

fs.write doesn't coerce data value to a string

Open xibre opened this issue 11 years ago • 1 comments

Hi. Today I tried to run something similar to this:

var data = true;
fs.write(fd, data, cb);

data value must be coerced to string as mentioned in API. But that failed with message:

Assertion failed: val->IsString() == true, file src\string_bytes.cc, line 286

fs.writeSync, however worked well.

Then I found this: https://github.com/iReal/io.js/blob/v1.x/lib/fs.js#L632-L633

There should be !==, not ===.

xibre avatar Mar 08 '15 15:03 xibre

@iReal thanks to @Fishrock123 this should now be fixed on HEAD. If this issue comes back up, please reopen the issue. Thanks for reporting this!

brendanashworth avatar Mar 08 '15 21:03 brendanashworth