Versions in this module Expand all Collapse all v1 v1.5.0 Jan 22, 2026 Changes in this version type Engine + Intrinsics *intrinsics.Registry v1.4.0 Jan 21, 2026 Changes in this version + var ErrMemoryLimitExceeded = errors.New("memory limit exceeded") + var GlobalHooks []GlobalEngineHook + func AddGlobalHook(hook GlobalEngineHook) + type Engine struct + EventLoop *eventloop.EventLoop + MemoryFactory *memory.Factory + MemoryLimit uint64 + OnError ErrorHandler + VM *goja.Runtime + func NewEngine(memoryLimit uint64, mf *memory.Factory) *Engine + func (e *Engine) BindStruct(name string, s interface{}) error + func (e *Engine) Close() + func (e *Engine) Context() context.Context + func (e *Engine) GlobalSet(name string, value interface{}) error + func (e *Engine) Run(js string) (goja.Value, error) + func (e *Engine) RunSafe(js string) (result goja.Value, err error) + func (e *Engine) SpawnWorker(scriptPath string, onMessage func(goja.Value)) (worker.Handle, error) + func (e *Engine) StartEmergencyMonitor(interval time.Duration) + func (e *Engine) StartMemoryMonitor(interval time.Duration) + func (e *Engine) WrapError(recovered interface{}) error + type ErrorHandler func(err error, stack string) + type GlobalEngineHook func(eng *Engine) + type WorkerInstance struct + func (w *WorkerInstance) PostMessage(msg goja.Value) + func (w *WorkerInstance) Terminate()