Versions in this module Expand all Collapse all v0 v0.0.1 Sep 26, 2022 Changes in this version + var InvalidRuneError = errors.New("invalid rune") + var SymHasInstance = newSymbol(asciiString("Symbol.hasInstance")) + var SymIsConcatSpreadable = newSymbol(asciiString("Symbol.isConcatSpreadable")) + var SymIterator = newSymbol(asciiString("Symbol.iterator")) + var SymMatch = newSymbol(asciiString("Symbol.match")) + var SymMatchAll = newSymbol(asciiString("Symbol.matchAll")) + var SymReplace = newSymbol(asciiString("Symbol.replace")) + var SymSearch = newSymbol(asciiString("Symbol.search")) + var SymSpecies = newSymbol(asciiString("Symbol.species")) + var SymSplit = newSymbol(asciiString("Symbol.split")) + var SymToPrimitive = newSymbol(asciiString("Symbol.toPrimitive")) + var SymToStringTag = newSymbol(asciiString("Symbol.toStringTag")) + var SymUnscopables = newSymbol(asciiString("Symbol.unscopables")) + func IsInfinity(v Value) bool + func IsNaN(v Value) bool + func IsNull(v Value) bool + func IsUndefined(v Value) bool + func Parse(name, src string, options ...parser.Option) (prg *js_ast.Program, err error) + type ArrayBuffer struct + func (a ArrayBuffer) Bytes() []byte + func (a ArrayBuffer) Detach() bool + func (a ArrayBuffer) Detached() bool + type Callable func(this Value, args ...Value) (Value, error) + func AssertFunction(v Value) (Callable, bool) + type CompilerError struct + File *file.File + Message string + Offset int + type CompilerReferenceError struct + func (e *CompilerReferenceError) Error() string + type CompilerSyntaxError struct + func (e *CompilerSyntaxError) Error() string + type Constructor func(newTarget *Object, args ...Value) (*Object, error) + func AssertConstructor(v Value) (Constructor, bool) + type ConstructorCall struct + Arguments []Value + NewTarget *Object + This *Object + func (f ConstructorCall) Argument(idx int) Value + type DynamicArray interface + Get func(idx int) Value + Len func() int + Set func(idx int, val Value) bool + SetLen func(int) bool + type DynamicObject interface + Delete func(key string) bool + Get func(key string) Value + Has func(key string) bool + Keys func() []string + Set func(key string, val Value) bool + type Exception struct + func (e *Exception) Error() string + func (e *Exception) String() string + func (e *Exception) Value() Value + type FieldNameMapper interface + FieldName func(t reflect.Type, f reflect.StructField) string + MethodName func(t reflect.Type, m reflect.Method) string + func TagFieldNameMapper(tagName string, uncapMethods bool) FieldNameMapper + func UncapFieldNameMapper() FieldNameMapper + type Flag int + const FLAG_FALSE + const FLAG_NOT_SET + const FLAG_TRUE + func ToFlag(b bool) Flag + func (f Flag) Bool() bool + type FunctionCall struct + Arguments []Value + This Value + func (f FunctionCall) Argument(idx int) Value + type InterruptedError struct + func (e *InterruptedError) Error() string + func (e *InterruptedError) String() string + func (e *InterruptedError) Unwrap() error + func (e *InterruptedError) Value() interface{} + type JsonEncodable interface + JsonEncodable func() interface{} + type Now func() time.Time + type Object struct + func NewSharedDynamicArray(a DynamicArray) *Object + func NewSharedDynamicObject(d DynamicObject) *Object + func (o *Object) ClassName() string + func (o *Object) DefineAccessorProperty(name string, getter, setter Value, configurable, enumerable Flag) error + func (o *Object) DefineAccessorPropertySymbol(name *Symbol, getter, setter Value, configurable, enumerable Flag) error + func (o *Object) DefineDataProperty(name string, value Value, writable, configurable, enumerable Flag) error + func (o *Object) DefineDataPropertySymbol(name *Symbol, value Value, writable, configurable, enumerable Flag) error + func (o *Object) Delete(name string) error + func (o *Object) DeleteSymbol(name *Symbol) error + func (o *Object) Equals(other Value) bool + func (o *Object) Export() (ret interface{}) + func (o *Object) ExportType() reflect.Type + func (o *Object) Get(name string) Value + func (o *Object) GetSymbol(sym *Symbol) Value + func (o *Object) Keys() (keys []string) + func (o *Object) MarshalJSON() ([]byte, error) + func (o *Object) Prototype() *Object + func (o *Object) SameAs(other Value) bool + func (o *Object) Set(name string, value interface{}) error + func (o *Object) SetPrototype(proto *Object) error + func (o *Object) SetSymbol(name *Symbol, value interface{}) error + func (o *Object) StrictEquals(other Value) bool + func (o *Object) String() string + func (o *Object) Symbols() []*Symbol + func (o *Object) ToBoolean() bool + func (o *Object) ToFloat() float64 + func (o *Object) ToInteger() int64 + func (o *Object) ToNumber() Value + func (o *Object) ToObject(*Runtime) *Object + func (o *Object) ToString() Value + type Program struct + func Compile(name, src string, strict bool) (*Program, error) + func CompileAST(prg *js_ast.Program, strict bool) (*Program, error) + func MustCompile(name, src string, strict bool) *Program + type Promise struct + func (p *Promise) Result() Value + func (p *Promise) State() PromiseState + type PromiseRejectionOperation int + const PromiseRejectionHandle + const PromiseRejectionReject + type PromiseRejectionTracker func(p *Promise, operation PromiseRejectionOperation) + type PromiseState int + const PromiseStateFulfilled + const PromiseStatePending + const PromiseStateRejected + type PropertyDescriptor struct + Configurable Flag + Enumerable Flag + Getter Value + Setter Value + Value Value + Writable Flag + func (p *PropertyDescriptor) Empty() bool + func (p *PropertyDescriptor) IsAccessor() bool + func (p *PropertyDescriptor) IsData() bool + func (p *PropertyDescriptor) IsGeneric() bool + type Proxy struct + func (p Proxy) Handler() *Object + func (p Proxy) Revoke() + func (p Proxy) Target() *Object + type ProxyTrapConfig struct + Apply func(target *Object, this Value, argumentsList []Value) (value Value) + Construct func(target *Object, argumentsList []Value, newTarget *Object) (value *Object) + DefineProperty func(target *Object, key string, propertyDescriptor PropertyDescriptor) (success bool) + DefinePropertyIdx func(target *Object, key int, propertyDescriptor PropertyDescriptor) (success bool) + DefinePropertySym func(target *Object, key *Symbol, propertyDescriptor PropertyDescriptor) (success bool) + DeleteProperty func(target *Object, property string) (success bool) + DeletePropertyIdx func(target *Object, property int) (success bool) + DeletePropertySym func(target *Object, property *Symbol) (success bool) + Get func(target *Object, property string, receiver Value) (value Value) + GetIdx func(target *Object, property int, receiver Value) (value Value) + GetOwnPropertyDescriptor func(target *Object, prop string) (propertyDescriptor PropertyDescriptor) + GetOwnPropertyDescriptorIdx func(target *Object, prop int) (propertyDescriptor PropertyDescriptor) + GetOwnPropertyDescriptorSym func(target *Object, prop *Symbol) (propertyDescriptor PropertyDescriptor) + GetPrototypeOf func(target *Object) (prototype *Object) + GetSym func(target *Object, property *Symbol, receiver Value) (value Value) + Has func(target *Object, property string) (available bool) + HasIdx func(target *Object, property int) (available bool) + HasSym func(target *Object, property *Symbol) (available bool) + IsExtensible func(target *Object) (success bool) + OwnKeys func(target *Object) (object *Object) + PreventExtensions func(target *Object) (success bool) + Set func(target *Object, property string, value Value, receiver Value) (success bool) + SetIdx func(target *Object, property int, value Value, receiver Value) (success bool) + SetPrototypeOf func(target *Object, prototype *Object) (success bool) + SetSym func(target *Object, property *Symbol, value Value, receiver Value) (success bool) + type RandSource func() float64 + type Runtime struct + func New() *Runtime + func (r *Runtime) CaptureCallStack(depth int, stack []StackFrame) []StackFrame + func (r *Runtime) ClearInterrupt() + func (r *Runtime) CreateObject(proto *Object) *Object + func (r *Runtime) ExportTo(v Value, target interface{}) error + func (r *Runtime) Get(name string) (ret Value) + func (r *Runtime) GlobalObject() *Object + func (r *Runtime) Interrupt(v interface{}) + func (r *Runtime) New(construct Value, args ...Value) (o *Object, err error) + func (r *Runtime) NewArray(items ...interface{}) *Object + func (r *Runtime) NewArrayBuffer(data []byte) ArrayBuffer + func (r *Runtime) NewDynamicArray(a DynamicArray) *Object + func (r *Runtime) NewDynamicObject(d DynamicObject) *Object + func (r *Runtime) NewGoError(err error) *Object + func (r *Runtime) NewObject() (v *Object) + func (r *Runtime) NewPromise() (promise *Promise, resolve func(result interface{}), ...) + func (r *Runtime) NewProxy(target *Object, nativeHandler *ProxyTrapConfig) Proxy + func (r *Runtime) NewTypeError(args ...interface{}) *Object + func (r *Runtime) RunProgram(p *Program) (result Value, err error) + func (r *Runtime) RunScript(name, src string) (Value, error) + func (r *Runtime) RunString(str string) (Value, error) + func (r *Runtime) Set(name string, value interface{}) error + func (r *Runtime) SetFieldNameMapper(mapper FieldNameMapper) + func (r *Runtime) SetMaxCallStackSize(size int) + func (r *Runtime) SetParserOptions(opts ...parser.Option) + func (r *Runtime) SetPromiseRejectionTracker(tracker PromiseRejectionTracker) + func (r *Runtime) SetRandSource(source RandSource) + func (r *Runtime) SetTimeSource(now Now) + func (r *Runtime) ToValue(i interface{}) Value + type StackFrame struct + func (f *StackFrame) FuncName() string + func (f *StackFrame) Position() file.Position + func (f *StackFrame) SrcName() string + func (f *StackFrame) Write(b *bytes.Buffer) + func (f *StackFrame) WriteToValueBuilder(b *valueStringBuilder) + type StackOverflowError struct + type Symbol struct + func NewSymbol(s string) *Symbol + func (s *Symbol) Equals(o Value) bool + func (s *Symbol) Export() interface{} + func (s *Symbol) ExportType() reflect.Type + func (s *Symbol) SameAs(other Value) bool + func (s *Symbol) StrictEquals(o Value) bool + func (s *Symbol) String() string + func (s *Symbol) ToBoolean() bool + func (s *Symbol) ToFloat() float64 + func (s *Symbol) ToInteger() int64 + func (s *Symbol) ToNumber() Value + func (s *Symbol) ToObject(r *Runtime) *Object + func (s *Symbol) ToString() Value + type Value interface + Equals func(Value) bool + Export func() interface{} + ExportType func() reflect.Type + SameAs func(Value) bool + StrictEquals func(Value) bool + String func() string + ToBoolean func() bool + ToFloat func() float64 + ToInteger func() int64 + ToNumber func() Value + ToObject func(*Runtime) *Object + ToString func() Value + func NaN() Value + func NegativeInf() Value + func Null() Value + func PositiveInf() Value + func Undefined() Value