-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Please include the following in your bug report:
Version of emscripten/emsdk:
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.46-git (19607820c447a13fd8d0b7680c56148427d6e1b8)
clang version 18.0.0 (https://github.com/llvm/llvm-project d2ab97b00ce702006f7b1098e3530094759c8841)
Target: wasm32-unknown-emscripten
Thread model: posix
InstalledDir: /home/rreverser/emsdk/upstream/bin
Failing command line in full:
emcc test.c --js-library test-lib.js -pthread -s PROXY_TO_PTHREADtest.c:
extern void foobar();
int main() {
foobar();
}test-lib.js:
addToLibrary({
foobar: () => setTimeout(() => {
console.log('hello from main thread');
}, 1000),
foobar__proxy: 'sync',
});For some reason arrow functions wrapped like this (whether it's setTimeout, Asyncify.handleSleep or anything else) get quietly unwrapped in the output so it becomes:
function _foobar() {
if (ENVIRONMENT_IS_PTHREAD)
return proxyToMainThread(4, 1);
console.log('hello from main thread');
}Which, of course, behaves very differently in weird ways in runtime.
Metadata
Metadata
Assignees
Labels
No labels