diff options
author | Yoshihiro Kikuchi <yknetg@gmail.com> | 2011-07-14 10:14:44 +0400 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2011-07-21 15:35:47 +0400 |
commit | 3c4c36068e0ead8d3442da59f46cd72d68a908bb (patch) | |
tree | 6ea4ebf553c69c04b94f33ab2b08adbf821441ad /lib | |
parent | 133036fdadbca1099cf1cf589987eea01236722e (diff) |
fs: added an argument check in fs.watchFile
Fixes #1324.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fs.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fs.js b/lib/fs.js index 29e1a3d2b1d..b907021b5cc 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -629,6 +629,10 @@ fs.watchFile = function(filename) { listener = arguments[1]; } + if (!listener) { + throw new Error('watchFile requires a listener function'); + } + if (options.persistent === undefined) options.persistent = true; if (options.interval === undefined) options.interval = 0; |