Restores ability to define host functions w/o context via reflection (#832)
This restores the ability to leave out the initial context parameter
when defining functions with reflection. This is important because some
projects are porting from a different library to wazero, and all the
alternatives are not contextualized.
For example, this project is porting envoy host functions, and the
original definitions (in mosn) don't have a context parameter. By being
lenient, they can migrate easier.
See 6b813482b6/pkg/proxywasm/wazero/imports_v1.go
Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -405,7 +405,7 @@ func TestRuntime_InstantiateModuleFromBinary_ErrorOnStart(t *testing.T) {
|
||||
r := NewRuntime(testCtx)
|
||||
defer r.Close(testCtx)
|
||||
|
||||
start := func(context.Context) {
|
||||
start := func() {
|
||||
panic(errors.New("ice cream"))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user