joyent/node — pull request #6022 by blmarket (2013-08-09 01:25:42+00:00)
Title: stream: Transform should allow falsey values

I've backported this commit from master branch(26ca7d73,
which was authored by Jeff Barczewski )
below is his commit message about why and how to fix this issue.

If a transform stream has objectMode = true, it should
allow falsey values other than (null) like 0, false, ''.

null is reserved to indicate stream eof but
other falsey values should flow through properly.

below is test case for this issue.

```coffee-script
stream = require 'stream'
util = require 'util'
Transform = stream.Transform

MyTransform = (options) ->
Transform.call(this, options)

util.inherits(MyTransform, Transform)

MyTransform.prototype._transform = (chunk, encoding, callback) ->
console.log chunk, encoding
callback null

tmp = new MyTransform { objectMode: true }

tmp.on 'finish', ->
console.log 'finish'

tmp.write('hello')
tmp.write('')
tmp.end('world')
```

Expected Result
```
hello utf8
utf8
world utf8
```

Actual
```
hello utf8
```