diff --git a/config.go b/config.go index 7fcaefa4..2dbd5585 100644 --- a/config.go +++ b/config.go @@ -137,6 +137,12 @@ type RuntimeConfig interface { WithWasmCore2() RuntimeConfig } +// NewRuntimeConfig returns a RuntimeConfig using the compiler if it is supported in this environment, +// or the interpreter otherwise. +func NewRuntimeConfig() RuntimeConfig { + return newRuntimeConfig() +} + type runtimeConfig struct { enabledFeatures wasm.Features newEngine func(wasm.Features) wasm.Engine diff --git a/config_supported.go b/config_supported.go index ae2085cc..48201f4c 100644 --- a/config_supported.go +++ b/config_supported.go @@ -2,7 +2,6 @@ package wazero -// NewRuntimeConfig returns NewRuntimeConfigCompiler -func NewRuntimeConfig() RuntimeConfig { +func newRuntimeConfig() RuntimeConfig { return NewRuntimeConfigCompiler() } diff --git a/config_unsupported.go b/config_unsupported.go index d88e9ac4..161eff38 100644 --- a/config_unsupported.go +++ b/config_unsupported.go @@ -2,7 +2,6 @@ package wazero -// NewRuntimeConfig returns NewRuntimeConfigInterpreter -func NewRuntimeConfig() RuntimeConfig { +func newRuntimeConfig() RuntimeConfig { return NewRuntimeConfigInterpreter() }