emscripten-core / emscripten-core/emscripten
C(++)->JS Argument binding.
- Lingua principale
- C++
- Stelle
- 27.6k
- Fork
- 3.6k
- Merge medio
- 1g 14h
- PR unite (30g)
- 125
Descrizione
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,
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Start by tracing the emscripten_asm_const_int entry point and the _EM_ASM_PREP_ARGS macro used in the example. Check the existing documentation and implementation for whether dynamically named JavaScript calls with typed, bound arguments are supported. Done would be a decided approach and corresponding documented behavior or implementation, with type safety and non-eval performance requirements addressed.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp, javascript, wasm
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100