At the moment, the runtime unconditionally gives access to the filesystem, as well as all WASI APIs (system clock, etc). It would be good to make those options.
|
if _, err := wsp1.Instantiate(option.Context, runtime.wrt); err != nil { |
|
return nil, fmt.Errorf("failed to instantiate WASI: %w", err) |
|
} |
|
|
|
if _, err := runtime.wrt.NewHostModuleBuilder("env"). |
|
NewFunctionBuilder(). |
|
WithFunc(option.ProxyFunction). |
|
Export("jsFunctionProxy"). |
|
Instantiate(option.Context); err != nil { |
|
return nil, fmt.Errorf("failed to setup host module: %w", err) |
|
} |
|
|
|
fsConfig := wazero. |
|
NewFSConfig(). |
|
WithDirMount(runtime.option.CWD, "/") |
At the moment, the runtime unconditionally gives access to the filesystem, as well as all WASI APIs (system clock, etc). It would be good to make those options.
qjs/runtime.go
Lines 123 to 137 in 461716f