Versions in this module Expand all Collapse all v0 v0.5.3 Apr 14, 2021 Changes in this version + func JSONStringify(ctx *Context, val Valuer) (string, error) + func SetFlags(flags ...string) + func Version() string + type Context struct + func NewContext(opt ...ContextOption) (*Context, error) + func (c *Context) Close() + func (c *Context) Global() *Object + func (c *Context) Isolate() (*Isolate, error) + func (c *Context) RunScript(source string, origin string) (*Value, error) + type ContextOption interface + type Function struct + func (fn *Function) Call(args ...Valuer) (*Value, error) + type FunctionCallback func(info *FunctionCallbackInfo) *Value + type FunctionCallbackInfo struct + func (i *FunctionCallbackInfo) Args() []*Value + func (i *FunctionCallbackInfo) Context() *Context + type FunctionTemplate struct + func NewFunctionTemplate(iso *Isolate, callback FunctionCallback) (*FunctionTemplate, error) + func (t FunctionTemplate) Set(name string, val interface{}, attributes ...PropertyAttribute) error + type HeapStatistics struct + ExternalMemory uint64 + HeapSizeLimit uint64 + MallocedMemory uint64 + NumberOfDetachedContexts uint64 + NumberOfNativeContexts uint64 + PeakMallocedMemory uint64 + TotalAvailableSize uint64 + TotalHeapSize uint64 + TotalHeapSizeExecutable uint64 + TotalPhysicalSize uint64 + UsedHeapSize uint64 + type Isolate struct + func NewIsolate() (*Isolate, error) + func (i *Isolate) Close() + func (i *Isolate) Dispose() + func (i *Isolate) GetHeapStatistics() HeapStatistics + func (i *Isolate) TerminateExecution() + type JSError struct + Location string + Message string + StackTrace string + func (e *JSError) Error() string + func (e *JSError) Format(s fmt.State, verb rune) + type Object struct + func (o *Object) Delete(key string) bool + func (o *Object) DeleteIdx(idx uint32) bool + func (o *Object) Get(key string) (*Value, error) + func (o *Object) GetIdx(idx uint32) (*Value, error) + func (o *Object) Has(key string) bool + func (o *Object) HasIdx(idx uint32) bool + func (o *Object) Set(key string, val interface{}) error + func (o *Object) SetIdx(idx uint32, val interface{}) error + type ObjectTemplate struct + func NewObjectTemplate(iso *Isolate) (*ObjectTemplate, error) + func (o *ObjectTemplate) NewInstance(ctx *Context) (*Object, error) + func (t ObjectTemplate) Set(name string, val interface{}, attributes ...PropertyAttribute) error + type Promise struct + func (p *Promise) Result() *Value + func (p *Promise) State() PromiseState + type PromiseResolver struct + func NewPromiseResolver(ctx *Context) (*PromiseResolver, error) + func (r *PromiseResolver) GetPromise() *Promise + func (r *PromiseResolver) Reject(err *Value) bool + func (r *PromiseResolver) Resolve(val Valuer) bool + type PromiseState int + const Fulfilled + const Pending + const Rejected + type PropertyAttribute uint8 + const DontDelete + const DontEnum + const None + const ReadOnly + type Value struct + func JSONParse(ctx *Context, str string) (*Value, error) + func NewValue(iso *Isolate, val interface{}) (*Value, error) + func (v *Value) ArrayIndex() (idx uint32, ok bool) + func (v *Value) AsFunction() (*Function, error) + func (v *Value) AsObject() (*Object, error) + func (v *Value) AsPromise() (*Promise, error) + func (v *Value) BigInt() *big.Int + func (v *Value) Boolean() bool + func (v *Value) DetailString() string + func (v *Value) Format(s fmt.State, verb rune) + func (v *Value) Int32() int32 + func (v *Value) Integer() int64 + func (v *Value) IsArgumentsObject() bool + func (v *Value) IsArray() bool + func (v *Value) IsArrayBuffer() bool + func (v *Value) IsArrayBufferView() bool + func (v *Value) IsAsyncFunction() bool + func (v *Value) IsBigInt() bool + func (v *Value) IsBigInt64Array() bool + func (v *Value) IsBigIntObject() bool + func (v *Value) IsBigUint64Array() bool + func (v *Value) IsBoolean() bool + func (v *Value) IsDataView() bool + func (v *Value) IsDate() bool + func (v *Value) IsExternal() bool + func (v *Value) IsFalse() bool + func (v *Value) IsFloat32Array() bool + func (v *Value) IsFloat64Array() bool + func (v *Value) IsFunction() bool + func (v *Value) IsGeneratorFunction() bool + func (v *Value) IsGeneratorObject() bool + func (v *Value) IsInt16Array() bool + func (v *Value) IsInt32() bool + func (v *Value) IsInt32Array() bool + func (v *Value) IsInt8Array() bool + func (v *Value) IsMap() bool + func (v *Value) IsMapIterator() bool + func (v *Value) IsModuleNamespaceObject() bool + func (v *Value) IsName() bool + func (v *Value) IsNativeError() bool + func (v *Value) IsNull() bool + func (v *Value) IsNullOrUndefined() bool + func (v *Value) IsNumber() bool + func (v *Value) IsNumberObject() bool + func (v *Value) IsObject() bool + func (v *Value) IsPromise() bool + func (v *Value) IsProxy() bool + func (v *Value) IsRegExp() bool + func (v *Value) IsSet() bool + func (v *Value) IsSetIterator() bool + func (v *Value) IsSharedArrayBuffer() bool + func (v *Value) IsString() bool + func (v *Value) IsStringObject() bool + func (v *Value) IsSymbol() bool + func (v *Value) IsSymbolObject() bool + func (v *Value) IsTrue() bool + func (v *Value) IsTypedArray() bool + func (v *Value) IsUint16Array() bool + func (v *Value) IsUint32() bool + func (v *Value) IsUint32Array() bool + func (v *Value) IsUint8Array() bool + func (v *Value) IsUint8ClampedArray() bool + func (v *Value) IsUndefined() bool + func (v *Value) IsWasmModuleObject() bool + func (v *Value) IsWeakMap() bool + func (v *Value) IsWeakSet() bool + func (v *Value) MarshalJSON() ([]byte, error) + func (v *Value) Number() float64 + func (v *Value) Object() *Object + func (v *Value) String() string + func (v *Value) Uint32() uint32 + type Valuer interface