Versions in this module Expand all Collapse all v0 v0.33.0 Nov 24, 2026 Changes in this version + const DefaultRegExpCache + const DefaultRegExpCacheBytes + const DefaultShapeCache + const EvalGlobal + const EvalModule + const MaxTrackedRejections + var ErrKilled = errors.New("beastjs: the script did not stop in time and was killed") + var GetAsyncContext = NewBuiltin("getAsyncContext", 0, func(a Args) (Value, error) { ... }) + var SetAsyncContext = NewBuiltin("setAsyncContext", 1, func(a Args) (Value, error) { ... }) + var UndefinedValue = Value + func Version() string + type Args struct + func (a Args) Bool(i int) (bool, bool) + func (a Args) Latin1(i int) (b []byte, ok bool) + func (a Args) Len() int + func (a Args) Number(i int) (float64, bool) + func (a Args) String(i int) (s string, ok bool) + func (a Args) StringLen(i int) (n int, ok bool) + func (a Args) This() Value + func (a Args) UTF16(i int) (u []uint16, ok bool) + func (a Args) VM() *VM + func (a Args) Value(i int) Value + func (a Args) WTF8(i int) (s string, ok bool) + type Atom = uint32 + type Builtin struct + func NewBuiltin(name string, length int, fn func(Args) (Value, error)) *Builtin + type Error struct + ColumnNumber int + FileName string + Interrupted bool + LineNumber int + Message string + Name string + OutOfMemory bool + Stack string + Uncatchable bool + func ErrorFromValue(v Value) *Error + func (e *Error) Error() string + func (e *Error) Is(target error) bool + type HostFunc func(args []any) (any, error) + type MemoryUsage struct + ArrayCount int64 + AtomCount int64 + AtomSize int64 + BinaryObjectCount int64 + BinaryObjectSize int64 + CFuncCount int64 + Chunks int64 + FastArrayCount int64 + FastArrayElements int64 + Footprint int64 + FootprintLimit int64 + FreeSize int64 + JSFuncCodeSize int64 + JSFuncCount int64 + JSFuncPC2LineCount int64 + JSFuncPC2LineSize int64 + JSFuncSize int64 + MallocCount int64 + MallocLimit int64 + MallocSize int64 + MemoryUsedCount int64 + MemoryUsedSize int64 + ObjCount int64 + ObjSize int64 + PropCount int64 + PropSize int64 + RegisterCodeCount int64 + RegisterCodeSize int64 + ReleaseCandidate int64 + ShapeCount int64 + ShapeSize int64 + StrCount int64 + StrSize int64 + type Object struct + func (o *Object) Into(v any) error + func (o *Object) MarshalJSON() ([]byte, error) + func (o *Object) String() string + type PromiseCapability struct + Promise Value + Reject Value + Resolve Value + func (pc *PromiseCapability) Dup() *PromiseCapability + func (pc *PromiseCapability) Free() + type SharedBytecode struct + func NewSharedBytecode(bytecode []byte) (*SharedBytecode, error) + func (b *SharedBytecode) Close() error + func (b *SharedBytecode) Len() int + type Strip int + const StripDebug + const StripSource + type Undefined struct + func (u Undefined) String() string + type Unsupported struct + func (u Unsupported) String() string + type VM struct + func NewVM() (*VM, error) + func (m *VM) Call(function string, args ...any) (r any, err error) + func (m *VM) CallValue(function string, args ...any) (r Value, err error) + func (m *VM) Close() (err error) + func (m *VM) Compile(javascript string, flags int) ([]byte, error) + func (m *VM) Eval(javascript string, flags int) (r any, err error) + func (m *VM) EvalBytecode(bytecode []byte) (r any, err error) + func (m *VM) EvalBytecodeValue(bytecode []byte) (r Value, err error) + func (m *VM) EvalFile(name, javascript string, flags int) (r Value, err error) + func (m *VM) EvalSharedBytecode(b *SharedBytecode) (r any, err error) + func (m *VM) EvalSharedBytecodeValue(b *SharedBytecode) (r Value, err error) + func (m *VM) EvalThis(obj Value, javascript string, flags int) (r any, err error) + func (m *VM) EvalThisValue(obj Value, javascript string, flags int) (r Value, err error) + func (m *VM) EvalValue(javascript string, flags int) (r Value, err error) + func (m *VM) ExecutePendingJobs() (n int, err error) + func (m *VM) GCThreshold() uintptr + func (m *VM) GetProperty(this Value, prop Atom) (r any, err error) + func (m *VM) GetPropertyValue(this Value, prop Atom) (r Value, err error) + func (m *VM) GlobalObject() (r Value) + func (m *VM) Interrupt() + func (m *VM) MemoryFree() uintptr + func (m *VM) MemorySize() uintptr + func (m *VM) MemoryUsage() MemoryUsage + func (m *VM) NewArray(vals ...Value) (Value, error) + func (m *VM) NewAtom(s string) (r Atom, err error) + func (m *VM) NewBuiltinFunction(b *Builtin) (Value, error) + func (m *VM) NewFloat64(n float64) Value + func (m *VM) NewInt(n int) Value + func (m *VM) NewMurmur2Function() (Value, error) + func (m *VM) NewObjectValue() (r Value, err error) + func (m *VM) NewPromiseCapability() (*PromiseCapability, error) + func (m *VM) NewString(s string) (r Value, err error) + func (m *VM) NewStringLatin1(b []byte) (Value, error) + func (m *VM) NewStringUTF16(u []uint16) (Value, error) + func (m *VM) Now() time.Time + func (m *VM) OnClose(f func()) + func (m *VM) RegisterCopyProps(name string) error + func (m *VM) RegisterEndTag(name string) error + func (m *VM) RegisterEscapeText(name string) error + func (m *VM) RegisterFunc(name string, f any, wantThis bool) error + func (m *VM) RegisterHostFunc(name string, fn HostFunc) error + func (m *VM) RegisterStartTag(name string) error + func (m *VM) ReleaseMemory(keep uintptr) (uintptr, error) + func (m *VM) RunGC() + func (m *VM) RunYoungGC() + func (m *VM) SetClock(now func() time.Time) + func (m *VM) SetEvalTimeout(d time.Duration) error + func (m *VM) SetGCThreshold(threshold uintptr) + func (m *VM) SetMaxStackSize(threshold uintptr) + func (m *VM) SetMemoryLimit(limit uintptr) + func (m *VM) SetProperty(this Value, prop Atom, val any) (err error) + func (m *VM) SetPropertyValue(this Value, prop Atom, val Value) (err error) + func (m *VM) SetRegExpCache(n, bytes int) error + func (m *VM) SetShapeCache(n int) error + func (m *VM) SetStrip(s Strip) + func (m *VM) TrackRejections(max int) (err error) + func (m *VM) UnhandledRejections() (reasons []*Error, dropped int, err error) + type Value struct + func (v *Value) Free() + func (v *Value) VM() *VM + func (v Value) Any() (r any, err error) + func (v Value) Call(this Value, args ...any) (r any, err error) + func (v Value) CallValue(this Value, args ...any) (r Value, err error) + func (v Value) Dup() Value + func (v Value) GetProperty(this Value, prop Atom) (r any, err error) + func (v Value) GetPropertyValue(prop Atom) (r Value, err error) + func (v Value) IsUndefined() bool + func (v Value) MarshalJSON() (r []byte, err error) + func (v Value) Property(prop Atom) (r any, err error) + func (v Value) SetProperty(prop Atom, val any) (err error) + func (v Value) SetPropertyValue(prop Atom, val Value) (err error) + func (v Value) Then(onFulfilled, onRejected func(Value)) (_ Value, err error)