assemblyscript
assemblyscript copied to clipboard
Missing function with raw bindings
Hey AS team,
Seems like the compiler isn't exporting functions that do not have and input parameters when run in --bindings raw
mode.
For example we have a simple function without any input parameters:
It shows up in the .wat
and .map
files:
Also in the .ts
type description:
but doesn't show up in the generated .js
bindings.
Functions without a need for glue code come directly from the .wasm file, while functions that need glue code are present in the .js file, wrapping their respective .wasm functions. Unless this is buggy, the final exports object should show all of them.
For context, this method was exported when we were previously using the ESM bindings, but do a whole host of issues with the support for ESM we decided to switch back to Common JS. So I would expect that all exported functions would be available to be called from JS using the --bindings raw
, especially if the function is part of the types exported in the .d.ts
file.
Perhaps to clarify: Unless there is a deeper issue, which I don't see any indications for, the function in question in fact exists, but only in the .wasm
, not in the accompanying .js
file. It does not show up in the .js
file because it is so simple that it does not require wrapping of arguments or similar, and is instead immediately re-exported from the .wasm
file. The .d.ts
describes the combination of both files.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions!