You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In CPP code,I will create a H5 element.
There is a close button on the dialog.
and i bind event listeners for close button by embind style.
When click "close" button, the dialog will be close and continue subsequent follow.
To achieve the blocking effect, I used the macro EM_ASYNC_JS to implement it.
In EM_ASYNC_JS Function,
I will create a Promise and listen "close" event for dialog element.
If the "close" event be triggered, The function will return a result.
But when actually executing,
The close event is triggered but it will not be returned to CPP
Version of emscripten/emsdk:
3.1.69
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.25 (febd44b21ecaca86e2cb2a25ef3ed4a0a2076365)
clang version 16.0.0 (https://github.com/llvm/llvm-project effd75bda4b1a9b26e554c1cda3e3b4c72fa0aa8)
Target: wasm32-unknown-emscripten
Full link command and output with -v appended:
emcc example.cpp exampleexport.cpp -o a.js -g -s ASYNCIFY --bind
After check the output result, I found it will output warning and error in terminal.
The output result as following:
before
waiting close begin
addEventListener for dialog
a.js:941 Aborted(Assertion failed: Cannot have multiple async operations in flight at once)
a.js:964 Uncaught RuntimeError: Aborted(Assertion failed: Cannot have multiple async operations in flight at once)
waiting close end
If I not use embind to bind event listeners for "close" button
I don't see anything immediately wrong with the example, but I do notice your output for emcc -v shows emscripten 3.1.25 which is very old. Maybe try a more recent version/ensure you're actually building with 3.1.69 like you mention.
I am currently simulating a modal dialog.
In CPP code,I will create a H5 element.
There is a close button on the dialog.
and i bind event listeners for close button by embind style.
When click "close" button, the dialog will be close and continue subsequent follow.
To achieve the blocking effect, I used the macro EM_ASYNC_JS to implement it.
In EM_ASYNC_JS Function,
I will create a Promise and listen "close" event for dialog element.
If the "close" event be triggered, The function will return a result.
But when actually executing,
The close event is triggered but it will not be returned to CPP
Version of emscripten/emsdk:
3.1.69
Full link command and output with
-v
appended:emcc example.cpp exampleexport.cpp -o a.js -g -s ASYNCIFY --bind
After check the output result, I found it will output warning and error in terminal.
The output result as following:
If I not use embind to bind event listeners for "close" button
The result is right.
The output result as following:
Does anyone have any idea about this issue?
If I use embind to bind events, how do I adjust my EM_ASYNC_JS function?
I am a beginner in emscripten and may not know much about it.
If there is anything wrong in my description, please forgive me.
The text was updated successfully, but these errors were encountered: