gojs: stubs all remaining filesystem calls to ENOSYS (#1001)
This stubs all remaining syscalls for `GOARCH=wasm GOOS=js` to return ENOSYS, instead of panic'ing. This allows us to see the parameters it receives. For example: ``` ==> go.syscall/js.valueCall(fs.truncate(path=/tmp/_Go_TestTruncate135754730,length=0)) <== (err=function not implemented,ok=false) ``` Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -9,6 +9,8 @@ import (
|
||||
)
|
||||
|
||||
// jsFn is a jsCall.call function, configured via jsVal.addFunction.
|
||||
//
|
||||
// Note: This is not a `func` because we need it to be a hashable type.
|
||||
type jsFn interface {
|
||||
invoke(ctx context.Context, mod api.Module, args ...interface{}) (interface{}, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user