Commit 789d45d
authored
Optimise handleAsync for JSPI (#20236)
* Optimise handleAsync for JSPI
With current handling, in JSPI mode handleAsync was doing unnecessary double wrapping-unwrapping of promises: invoke startAsync, it returns the promise, convert it to callback-style function with wakeUp, pass to handleSleep, handleSleep takes the callback and converts it back to another promise.
For JSPI Promises are native, so it makes more sense to invert the relationsheep between those 2 APIs and make handleAsync just await the original promise, while handleSleep would be the only one converting between callback and promise styles.
* Avoid unsupported syntax for async fn1 parent a7427d8 commit 789d45d
1 file changed
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
445 | 445 | | |
446 | | - | |
447 | | - | |
448 | | - | |
449 | | - | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
450 | 449 | | |
451 | | - | |
452 | | - | |
| 450 | + | |
453 | 451 | | |
454 | | - | |
455 | | - | |
456 | | - | |
457 | | - | |
458 | | - | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
459 | 456 | | |
460 | 457 | | |
461 | 458 | | |
| |||
0 commit comments