Versions in this module Expand all Collapse all v0 v0.1.1 Nov 15, 2026 Changes in this version type Runtime + func (rt *Runtime) RunContext(ctx context.Context, fn func(*Runtime) error) (err error) v0.1.0 Nov 9, 2026 Changes in this version + const PromiseFulfilled + const PromisePending + const PromiseRejected + const PromiseRejectionHandle + const PromiseRejectionReject + var Arg = engine.Arg + var Bool = engine.Bool + var ErrForeign = engine.ErrForeign + var ErrHookNotFound = errors.New("moejs: hook not found") + var ErrMemoryLimit = engine.ErrMemoryLimit + var ErrModulePending = engine.ErrModulePending + var ErrNoResolver = engine.ErrNoResolver + var ErrNotCallable = errors.New("moejs: not a function") + var ErrTooDeep = engine.ErrTooDeep + var ErrTooLarge = engine.ErrTooLarge + var Int = engine.Int64Value + var Null = engine.Null + var Number = engine.NumberValue + var Undefined = engine.Undefined + func PromiseResult(p Value) (state PromiseState, result Value, ok bool) + type CompileOptions struct + Context context.Context + TypeScript bool + type DecodeOptions = engine.DecodeOptions + type Exception = engine.Exception + type FunctionOptions struct + Async bool + Context context.Context + Generator bool + type Hook struct + func (h Hook) Name() string + type Importer struct + Meta func(r *Realm, m *Module, meta *Object) error + Resolve Resolver + type InternalError struct + Stack []byte + Value any + func (e *InternalError) Error() string + func (e *InternalError) Unwrap() error + type InterruptedError = engine.InterruptedError + type JSONOptions = engine.JSONOptions + type LiveReporter = engine.LiveReporter + type LossyJSONError = engine.LossyJSONError + type MemoryLimitError = engine.MemoryLimitError + type Module struct + func Compile(name, source string) (*Module, error) + func CompileTS(name, source string) (*Module, error) + func CompileWith(name, source string, opts CompileOptions) (*Module, error) + func Link(entry *Module, resolve Resolver) (*Module, error) + func (m *Module) Exports() []string + func (m *Module) Hook(export string, members ...string) (Hook, error) + func (m *Module) Name() string + func (m *Module) Requests() []string + type NativeFunc = engine.NativeFunc + type Object = engine.Object + type Options struct + DisableDynamicCode bool + Importer *Importer + Locale string + MaxDynamicSource int + MemoryLimit int64 + MutableIntrinsics bool + TimeZone *time.Location + type PromiseRejectionOperation = engine.PromiseRejectionOperation + type PromiseState = engine.PromiseState + type Realm = engine.Realm + type Referrer interface + Name func() string + type ResolveError struct + Column int + Err error + File string + Line int + Specifier string + func (e *ResolveError) Error() string + func (e *ResolveError) Unwrap() error + type Resolver func(referrer Referrer, specifier string) (*Module, error) + type Runtime struct + func NewRuntime(opts Options) *Runtime + func (rt *Runtime) AddLiveRoots(roots func(add func(Value))) (remove func()) + func (rt *Runtime) AppendJSON(dst []byte, v Value) (out []byte, err error) + func (rt *Runtime) AppendJSONWith(dst []byte, v Value, opts JSONOptions) (out []byte, err error) + func (rt *Runtime) Call(h Hook, args ...Value) (res Value, err error) + func (rt *Runtime) CallFunction(fn, this Value, args ...Value) (res Value, err error) + func (rt *Runtime) ClearInterrupt() + func (rt *Runtime) Export(name string) (v Value, ok bool) + func (rt *Runtime) FromGo(v any) (Value, error) + func (rt *Runtime) Function(name string, length int, fn NativeFunc) Value + func (rt *Runtime) Get(v Value, key string) (res Value, err error) + func (rt *Runtime) Has(h Hook) (ok bool, err error) + func (rt *Runtime) Interrupt(v any) + func (rt *Runtime) Load(m *Module) (err error) + func (rt *Runtime) Module() *Module + func (rt *Runtime) NewPromise() (p Value, resolve, reject func(v Value) error) + func (rt *Runtime) ParseJSON(b []byte) (Value, error) + func (rt *Runtime) ParseJSONString(s string) (Value, error) + func (rt *Runtime) Realm() *Realm + func (rt *Runtime) RebaseAllocation(roots func(add func(Value))) error + func (rt *Runtime) ReleaseCallData() + func (rt *Runtime) ResetAllocation() + func (rt *Runtime) RunScript(s *Script) (res Value, err error) + func (rt *Runtime) SetGlobal(name string, v any) (err error) + func (rt *Runtime) SetPromiseRejectionTracker(f func(p Value, op PromiseRejectionOperation)) + func (rt *Runtime) StackTrace(exc *Exception) string + func (rt *Runtime) Stats() Stats + func (rt *Runtime) ThrownValue(err error) (v Value, ok bool) + func (rt *Runtime) ToGo(v Value) (out any, err error) + func (rt *Runtime) ToGoInto(v Value, target any) error + func (rt *Runtime) ToGoIntoWith(v Value, target any, opts DecodeOptions) error + func (rt *Runtime) ToGoWith(v Value, opts DecodeOptions) (any, error) + func (rt *Runtime) Unmarshal(v Value, target any) (err error) + func (rt *Runtime) UnmarshalWith(v Value, target any, opts DecodeOptions) error + type Script struct + func CompileFunction(name, params, body string, opts FunctionOptions) (*Script, error) + func CompileFunctionTS(name, params, body string, opts FunctionOptions) (*Script, error) + func CompileScript(name, source string) (*Script, error) + func CompileScriptWith(name, source string, opts CompileOptions) (*Script, error) + func (s *Script) Name() string + type Stats = engine.Stats + type SyntaxError struct + Column int + File string + Line int + Message string + func (e *SyntaxError) Error() string + type Value = engine.Value + func String(s string) Value v0.1.0-alpha.11 Oct 27, 2026