Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C(++)->JS Argument binding. #16151

Open
FrozenSource opened this issue Jan 30, 2022 · 0 comments
Open

C(++)->JS Argument binding. #16151

FrozenSource opened this issue Jan 30, 2022 · 0 comments

Comments

@FrozenSource
Copy link

FrozenSource commented Jan 30, 2022

Hi guys,

Something I cannot find anywhere in the documentation is argument binding. You see, I would like to call a JS function dynamically but wish to bind the arguments to a template like EM_ASM does. Obviously I now get an error since the code is not in the consts.

    #define EM_CALL_EX(...) ((void) emscripten_asm_const_int(call.c_str() _EM_ASM_PREP_ARGS(__VA_ARGS__)))
                    EM_CALL_EX(5, "test");

Is there any way to call a function name dynamically but with a set amount of arguments and types? This is mostly for type safety and such; but also since apparently the speed would improve over the eval() method.

Sincerely,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant