Commit 1afc0c9
committed
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: #2093
Reviewed-By: Ben Noordhuis <[email protected]>1 parent 12bc397 commit 1afc0c9
2 files changed
+24
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1305 | 1305 | | |
1306 | 1306 | | |
1307 | 1307 | | |
1308 | | - | |
| 1308 | + | |
1309 | 1309 | | |
1310 | 1310 | | |
1311 | 1311 | | |
1312 | | - | |
1313 | 1312 | | |
1314 | | - | |
| 1313 | + | |
1315 | 1314 | | |
1316 | 1315 | | |
1317 | 1316 | | |
1318 | 1317 | | |
1319 | 1318 | | |
1320 | 1319 | | |
1321 | 1320 | | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
| 1321 | + | |
| 1322 | + | |
1325 | 1323 | | |
1326 | | - | |
| 1324 | + | |
| 1325 | + | |
1327 | 1326 | | |
1328 | 1327 | | |
1329 | | - | |
| 1328 | + | |
1330 | 1329 | | |
1331 | 1330 | | |
1332 | 1331 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments