Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function names from WebAssembly.Function #27

Closed
ghost opened this issue Feb 10, 2021 · 1 comment
Closed

Function names from WebAssembly.Function #27

ghost opened this issue Feb 10, 2021 · 1 comment

Comments

@ghost
Copy link

ghost commented Feb 10, 2021

In this simple example, what should be the function's name?

const print_1 = WebAssembly.Function({ parameters: [ "externref" ] }, console.log);

print_1( print_1.name );

Normally, when importing a function, it gets it's name from the order that it was imported in, so if this were to create a whole module to wrap it, then print_1.toString would show function 0() { [native code] }.

Should every call to WebAssembly.Function yield a function whose name is 0?

@ghost
Copy link
Author

ghost commented Jun 24, 2021

Seems like it's currently the JavaScrpt function's name. Definately breaks from plain Wasm importing, but it's not too important.

@ghost ghost closed this as completed Jun 24, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants