Commit e414ec8
committed
Fix Asyncify.handleAsync conflict with PROXY_SYNC_ASYNC
When a JS library function has both __proxy:'sync' and __async:'auto',
the compiler generates an Asyncify.handleAsync wrapper. When called
from the PROXY_SYNC_ASYNC path on the main thread, handleAsync
triggers an Asyncify unwind instead of returning a Promise, causing
"rtn.then is not a function" in the proxy infrastructure.
Fix by generating a PThread.currentProxiedOperationCallerThread check
in handleAsyncFunction (jsifier.mjs): when in a proxied context, call
the inner function directly and skip the Asyncify unwind, letting the
proxy mechanism handle the async return.1 parent 312eed6 commit e414ec8
2 files changed
+29
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
| 363 | + | |
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
369 | 374 | | |
370 | 375 | | |
371 | 376 | | |
372 | 377 | | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
373 | 386 | | |
374 | 387 | | |
375 | 388 | | |
| |||
474 | 487 | | |
475 | 488 | | |
476 | 489 | | |
| 490 | + | |
| 491 | + | |
477 | 492 | | |
478 | | - | |
| 493 | + | |
479 | 494 | | |
480 | | - | |
481 | | - | |
482 | 495 | | |
483 | 496 | | |
484 | 497 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9645 | 9645 | | |
9646 | 9646 | | |
9647 | 9647 | | |
| 9648 | + | |
| 9649 | + | |
| 9650 | + | |
| 9651 | + | |
| 9652 | + | |
| 9653 | + | |
| 9654 | + | |
| 9655 | + | |
| 9656 | + | |
| 9657 | + | |
| 9658 | + | |
| 9659 | + | |
9648 | 9660 | | |
9649 | 9661 | | |
9650 | 9662 | | |
| |||
0 commit comments