jjzjj

assemblyscript

全部标签

javascript - 使用内存获取字符串会产生不正确的结果

我正在关注这里的解决方案:HowcanIreturnaJavaScriptstringfromaWebAssemblyfunction和这里:Howtoreturnastring(orsimilar)fromRustinWebAssembly?但是,当从内存中读取时,我没有得到想要的结果。AssemblyScript文件,helloWorldModule.ts:exportfunctiongetMessageLocation():string{return"HelloWorld";}index.html:fetch("helloWorldModule.wasm").then(respo