Commit 1afc0c9e authored by Brendan Ashworth's avatar Brendan Ashworth
Browse files

fs: fix error on bad listener type

When the listener was truthy but NOT a function, fs.watchFile would
throw an error through the EventEmitter. This caused a problem because
it would only be thrown after the listener was started, which left the
listener on.

There should be no backwards compatability issues because the error was
always thrown, just in a different manner.

Also adds tests for this and other basic functionality.

PR-URL: https://github.com/nodejs/io.js/pull/2093


Reviewed-By: default avatarBen Noordhuis <info@bnoordhuis.nl>
parent 12bc3972
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment