This adds ResultNames to HostFunctionBuilder and FunctionDefinition which helps for multi-results or special-cased ones. End users can access result names in `FunctionDefinition.ResultNames` or set for their own host functions via `HostFunctionBuilder.WithResultNames`. This change adds them for all built-in functions where result names help. Most notably, GOOS=js uses `ProxyFunc` to allow logging when a function returns multiple results. Before, the results were returned without names: e.g. `11231,1` and now they are named like `n=11231,ok=1`. We soon plan to allow more visibility in WASI, for example, logging results that will write to memory offsets. This infrastructure makes it possible to do that. Signed-off-by: Adrian Cole <adrian@tetrate.io>
13 KiB
13 KiB