Skip to content

read should allow returning falsy values #11

@Raynos

Description

@Raynos
var s = new Readable()
    , list = [0,1,2,3]

s.read = function(bytes) {
    var chunk = list.shift()
    if (chunk === undefined) {
        s.emit("end")
        return null
    }
    return chunk
}

s.pipe(stringer).pipe(process.stdout)

Won't work as s returns 0 as one of the read return values. The flow of readable-stream should check explicitly for the value null and not any falsey values

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions