Commit 8b93a18
authored
fix(sio): allow emitWithAck() for events with void callbacks (#5453)
EventNamesWithAck previously excluded events whose callback had no
non-error arguments (e.g. `(cb: () => void) => void` or
`(cb: (err: Error) => void) => void`). This made it impossible to use
emitWithAck as a simple acknowledgement mechanism without data.
The fix removes the FirstNonErrorArg void check while keeping the guard
against events with no parameters at all, so events like `() => void`
(no callback) are still correctly excluded.
Related: #52571 parent e6c722e commit 8b93a18
2 files changed
Lines changed: 14 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
32 | 30 | | |
33 | 31 | | |
34 | 32 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
40 | 38 | | |
41 | 39 | | |
42 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
269 | | - | |
270 | 268 | | |
271 | 269 | | |
272 | 270 | | |
273 | 271 | | |
274 | 272 | | |
275 | | - | |
276 | | - | |
277 | 273 | | |
278 | 274 | | |
279 | 275 | | |
| |||
420 | 416 | | |
421 | 417 | | |
422 | 418 | | |
423 | | - | |
424 | | - | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
425 | 422 | | |
426 | 423 | | |
427 | 424 | | |
| |||
496 | 493 | | |
497 | 494 | | |
498 | 495 | | |
499 | | - | |
500 | | - | |
501 | | - | |
502 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
503 | 502 | | |
504 | 503 | | |
505 | 504 | | |
| |||
0 commit comments