Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYoshihiro Kikuchi <yknetg@gmail.com>2011-07-14 10:14:44 +0400
committerBen Noordhuis <info@bnoordhuis.nl>2011-07-21 15:35:47 +0400
commit3c4c36068e0ead8d3442da59f46cd72d68a908bb (patch)
tree6ea4ebf553c69c04b94f33ab2b08adbf821441ad /lib
parent133036fdadbca1099cf1cf589987eea01236722e (diff)
fs: added an argument check in fs.watchFile
Fixes #1324.
Diffstat (limited to 'lib')
-rw-r--r--lib/fs.js4
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;