binaryen
binaryen copied to clipboard
How to define parameter names?
Hello, new here. Does Binaryen output only unnamed "minified" code when it comes to things like parameters?
I see examples that do this only:
const params = binaryen.createType([i32, i32]) // no names, just number types
module.addFunction('foo', params, ...)
The TypeScript type definitions for binaryen.js are all just number (pointers I'd guess) with no docs, so hard to tell what to do.
Binaryen itself does support the names section, which includes parameter types. But it looks like we don't have support for all those things in the C and JS APIs yet, so that would need adding.
@trusktr you can however call setLocalName once the function is created. They don't show in the type, but they show in the function body.