emscripten-core / emscripten-core/emscripten

C(++)->JS Argument binding.

Open
#16,151 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

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,

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.