(snippet, sig)
| 360 | } |
| 361 | |
| 362 | function handleAsyncFunction(snippet, sig) { |
| 363 | const return64 = sig && (MEMORY64 && sig.startsWith('p') || sig.startsWith('j')) |
| 364 | let handleAsync = 'Asyncify.handleAsync(innerFunc)' |
| 365 | if (return64 && ASYNCIFY == 1) { |
| 366 | handleAsync = makeReturn64(handleAsync); |
| 367 | } |
| 368 | return modifyJSFunction(snippet, (args, body, async_, oneliner) => { |
| 369 | if (!oneliner) { |
| 370 | body = `{\n${body}\n}`; |
| 371 | } |
| 372 | return `\ |
| 373 | function(${args}) { |
| 374 | let innerFunc = ${async_} () => ${body}; |
| 375 | return ${handleAsync}; |
| 376 | }\n`; |
| 377 | }); |
| 378 | } |
| 379 | |
| 380 | // The three different inter-thread proxying methods. |
| 381 | // See system/lib/pthread/proxying.c |
no test coverage detected