fs: added an argument check in fs.watchFile

Fixes #1324.
v0.7.4-release
Yoshihiro Kikuchi 2011-07-14 15:14:44 +09:00 committed by Ben Noordhuis
parent 133036fdad
commit 3c4c36068e
1 changed files with 4 additions and 0 deletions

View File

@ -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;