Commit 24354fb
committed
Add resume_saxerror tests and fix async iterator SAX error handling
- Add test/feeds/saxerror.xml: RSS feed with a bare & that triggers a SAX
error in strict mode, used to demonstrate both resume behaviours
- In handleSaxError, set/clear a _isSaxError flag around emit() so that
listeners can distinguish SAX errors from fatal errors synchronously
- In Symbol.asyncIterator, ignore resumable SAX errors in onError (check
_isSaxError && resume_saxerror) so that parsing continues rather than
throwing; fatal errors (resume_saxerror: false, or non-SAX errors) still
propagate as exceptions
- Tests use write()+end() via setImmediate instead of pipe(): readable-stream
v2 calls unpipe() when the destination emits 'error', which prevents _flush
from ever being called and the stream from ending
https://claude.ai/code/session_01Rx48d2xCMjtzmoynPwet771 parent 461e2d8 commit 24354fb
3 files changed
+66
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
| 134 | + | |
134 | 135 | | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
1239 | 1241 | | |
1240 | 1242 | | |
1241 | 1243 | | |
| 1244 | + | |
1242 | 1245 | | |
1243 | 1246 | | |
1244 | 1247 | | |
| |||
1251 | 1254 | | |
1252 | 1255 | | |
1253 | 1256 | | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
1254 | 1260 | | |
1255 | 1261 | | |
1256 | 1262 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
18 | 55 | | |
19 | 56 | | |
20 | 57 | | |
| |||
| 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 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
0 commit comments