Commit c58128a
committed
Also emit 'file' event for files with syntax errors
Previously, `parseDeps` emitted an error event when there was a syntax
error, and then returned undefined. Inside `persistentCacheFallback()`,
then, the callback would not be called. This used to be OK but the
persistent cache changes in v6 changed the callback, so now _it_ is
responsible for 'file' and 'error' events.
This patch changes `parseDeps` to throw instead of emit an error. This
bubbles up to `persistentCacheFallback()` where it is caught and passed
to the callback. Then that callback will first emit a 'file' event for
the file and only then emit the 'error' event.
This makes watchify aware of the file, so it will watch it and rebuild
when it changes. Fixes #144 (really this time!)1 parent fe0e6e4 commit c58128a
2 files changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
417 | 417 | | |
418 | 418 | | |
419 | 419 | | |
420 | | - | |
| 420 | + | |
| 421 | + | |
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
| |||
434 | 435 | | |
435 | 436 | | |
436 | 437 | | |
437 | | - | |
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
508 | 508 | | |
509 | | - | |
510 | | - | |
| 509 | + | |
511 | 510 | | |
512 | 511 | | |
513 | 512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
18 | | - | |
| 22 | + | |
19 | 23 | | |
0 commit comments