emscripten-core / emscripten-core/emscripten
Named arguments(destructuring assignment) do not work for library functions
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
The following example doesn't work. We'll need to update the regex for arrow functions [here](https://github.com/emscripten-core/emscripten/blob/d6f18aee98d183bde8210029975d68cae54a74c4/src/jsifier.mjs#L601) to support this.
```js
addToLibrary({
$zzz: ({num}) => {
console.log(num);
},
hello_world__deps: ['$zzz'],
hello_world: (num) => {
zzz({num});
}
});
```
```c
#include
#include
extern void hello_world(int);
int main() {
hello_world(99);
}
```
Contributor guide
Assessment
This issue has not been assessed yet.