bytecodealliance / jco

JavaScript tooling for working with WebAssembly Components
https://bytecodealliance.github.io/jco/
Apache License 2.0
571 stars 53 forks source link

fix: isolate runtime states per component instance #446

Closed kateinoigakukun closed 3 weeks ago

kateinoigakukun commented 4 weeks 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.