dart-archive/wasm

[bindgen] functions starting with an underscore

modulovalue opened this issue · 1 comments

Consider the following set of exports (from tree-sitter in this case):

...
export function: int32 towupper(int32)
export function: int32 __errno_location()
export function: int32 memchr(int32, int32, int32)
export function: int32 strlen(int32)
export function: int32 stackSave()
export function: void stackRestore(int32)
export function: int32 stackAlloc(int32)
export function: void setThrew(int32, int32)
export function: int32 _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev(int32)
export function: void _ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm(int32, int32, int32, int32, int32, int32, int32)
...

Notice that there are functions starting with an underscore. I guess this is a convention to signal that a function is private and not meant to be used? Should we generate bindings for them? (I'm wondering if there are already some established expectations here)

#120 prepends a $ to generated bindings (to avoid clashes) and exposes private WASM functions.