You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If asc is used to compile multiple files, and one of those files is resolved via --path, then memory set in that file is not persisted. If --path is not used, the memory persists.
I am trying to build a library that exposes some standard functions to the javascript host. However, because the functions exported in the library cannot manipulate any state that the main program has access to, they aren't useful.
Bug description
If
asc
is used to compile multiple files, and one of those files is resolved via--path
, then memory set in that file is not persisted. If--path
is not used, the memory persists.Steps to reproduce
index.html
main.ts
lib/utils/types.ts
lib/utils/module.ts
Compile with
asc main.ts lib/utils/module.ts -o main.wasm --bindings esm --path lib
Run
npx http-server
Open
http://localhost:8080
and open the debug console.The output should be:
This shows that the memory is not being set correctly.
Now to prove it is a
--path
issue, we will use relative imports, instead of path imports. Change main.ts to:Compile with
asc main.ts lib/utils/module.ts -o main.wasm --bindings esm
Visit in the browser (you may need to hard refresh). The output will be
This shows that the memory is being set correctly.
AssemblyScript version
0.27.31
The text was updated successfully, but these errors were encountered: