bytecodealliance / jco

JavaScript toolchain for working with WebAssembly Components
https://bytecodealliance.github.io/jco/
Apache License 2.0
642 stars 64 forks source link

fix: isolate runtime states per component instance #446

Closed kateinoigakukun closed 5 months ago

kateinoigakukun commented 5 months ago

Thanks to no-reentrancy of CM, we can safely share the runtime state within a component instantiation closure. However, we cannot share the state across different component instances created by different instantiate calls.

This commit fixes the issue by moving all the runtime states under the instantiate scope.