node-wasm | Import and use wasm in node | Runtime Evironment library
kandi X-RAY | node-wasm Summary
kandi X-RAY | node-wasm Summary
Import and use wasm in node
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of node-wasm
node-wasm Key Features
node-wasm Examples and Code Snippets
Community Discussions
Trending Discussions on node-wasm
QUESTION
I am playing around with WASM in nodejs and noticed that function.name
for a WASM module is 0
, even though my WAT file export a function name.
Why does a WASM module not set the export name? Is there any performance issues with WASM setting the export name in function.name
in JS? Is this nodejs specific or missing in WebAssembly spec?
I hope my question is clear. I want to know why function.name
is 0
for a WASM module.
I am using wabt
@1.0.13 to compile a simple WAT file.
ANSWER
Answered 2020-Oct-10 at 01:26The name of the exported Wasm function is defined to be the index.
You already have the actual exported name since you have to import add
by its name.
Also see https://developer.mozilla.org/en-US/docs/WebAssembly/Exported_functions where they call testFunc.toString()
and the resulting function has name 0
.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install node-wasm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page