Documentation
¶
Overview ¶
Package jsvm runs the scripts the tool ships, the mini-program and HarmonyOS runtimes', on moejs for their tests: a script's values, Go functions JS calls and JS functions Go calls.
Index ¶
- func AssertFunction(v Value) (func(this Value, args ...Value) (Value, error), bool)
- type FunctionCall
- type Runtime
- func (vm *Runtime) ExportTo(v Value, target *func(string) string) error
- func (vm *Runtime) Get(name string) Value
- func (vm *Runtime) Global() Value
- func (vm *Runtime) NewObject() Value
- func (vm *Runtime) RunString(src string) (Value, error)
- func (vm *Runtime) Set(name string, v any)
- func (vm *Runtime) ToValue(v any) Value
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FunctionCall ¶
type FunctionCall struct{ Arguments []Value }
FunctionCall is a call of a Go function from JS.
func (FunctionCall) Argument ¶
func (c FunctionCall) Argument(i int) Value
Argument returns argument i, undefined when missing.
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
Runtime is a realm whose builtins scripts may patch.