emscripten-core / emscripten-core/emscripten
Support custom import namespace for functions implemented in JavaScript
Open
- Dominant language
- C++
- Stars
- 27.6k
- Forks
- 3.6k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 105
Description
Can I specify a custom import namespace for JavaScript function?
```js
mergeInto(LibraryManager.library, {
napi_create_int32: function (env, value, result) {
// ...
},
napi_create_int32__sig: 'ipip',
napi_create_int32__namespace: 'napi' // <-- instead of 'env'
})
```
compile result
```js
WebAssembly.instantiate(/* ... */, {
napi: { napi_create_int32 }
})
```
Refs: https://github.com/nodejs/node/pull/49037
Contributor guide
Assessment
This issue has not been assessed yet.