Adds gojs.MustInstantiate to avoid conflicts (#940)
This separate host from guest instantiation in ways similar to other imports such as emscripten. Doing so allows parallel use of gojs.Run, provided the ModuleConfig has been assigned a unique name (e.g. via an atomic number). Fixes #939 Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -27,6 +27,8 @@ func compileAndRun(ctx context.Context, arg string, config wazero.ModuleConfig)
|
||||
r := wazero.NewRuntimeWithConfig(testCtx, wazero.NewRuntimeConfig())
|
||||
defer r.Close(ctx)
|
||||
|
||||
gojs.MustInstantiate(ctx, r)
|
||||
|
||||
compiled, compileErr := r.CompileModule(ctx, testBin)
|
||||
if compileErr != nil {
|
||||
err = compileErr
|
||||
|
||||
Reference in New Issue
Block a user