projects
/
platform
/
upstream
/
nodejs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
133036f
)
fs: added an argument check in fs.watchFile
author
Yoshihiro Kikuchi
<yknetg@gmail.com>
Thu, 14 Jul 2011 06:14:44 +0000
(15:14 +0900)
committer
Ben Noordhuis
<info@bnoordhuis.nl>
Thu, 21 Jul 2011 11:35:47 +0000
(13:35 +0200)
Fixes #1324.
lib/fs.js
patch
|
blob
|
history
diff --git
a/lib/fs.js
b/lib/fs.js
index
29e1a3d
..
b907021
100644
(file)
--- 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;