Skip to content

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

Closed
@xibre

Description

@xibre

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 ===.

Activity

added
fsIssues and PRs related to the fs subsystem / file system.
on Mar 8, 2015
brendanashworth

brendanashworth commented on Mar 8, 2015

@brendanashworth
Contributor

@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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      fs.write doesn't coerce data value to a string · Issue #1098 · nodejs/node