Skip to content

Commit 5647eb4

Browse files
committed
Don't mark proxy async funcs as Asyncify
In #19093 both async functions and functions marked with `NAME__async: true` were marked as functions to be processed by Asyncify. However, looking at usages, standalone async functions are currently used with emscripten_proxy_finish-based callbacks and not with Asyncify. Besides, such functions can't work with Asyncify unless we add automatic `Asyncify.handleAsync` wrapping around each such function as well. We could do that, but given that there are already is some confusion around what async means for any particular function, it seems better to keep explicit calls to `emscripten_proxy_finish` and `Asyncify.handleAsync` correspondingly. Hence, in this PR I'm not adding more automatic wrapping but instead just removing the assumption for standalone async functions which should somewhat reduce code size as they will no longer be Asyncify-ed when not necessary.
1 parent dec7f7d commit 5647eb4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/jsifier.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,9 @@ function(${args}) {
326326
deps.push('setTempRet0');
327327
}
328328

329-
let isAsyncFunction = false;
330329
if (ASYNCIFY) {
331330
const original = LibraryManager.library[symbol];
332-
if (typeof original == 'function' ) {
333-
isAsyncFunction = LibraryManager.library[symbol + '__async'] ||
334-
original.constructor.name == 'AsyncFunction'
335-
}
336-
if (isAsyncFunction) {
331+
if (typeof original == 'function' && LibraryManager.library[symbol + '__async']) {
337332
asyncFuncs.push(symbol);
338333
}
339334
}

0 commit comments

Comments
 (0)