Versions in this module Expand all Collapse all v1 v1.7.4 Jul 11, 2023 Changes in this version + var CompileModeDefault = CompileMode(C.ScriptCompilerNoCompileOptions) + var CompileModeEager = CompileMode(C.ScriptCompilerEagerCompile) + var ErrUnsupportedValueType = fmt.Errorf("v8go: unsupported value type") + func JSONStringify(ctx *Context, val Valuer) (string, error) + func SetFlags(flags ...string) + func Version() string + type Array struct + func NewArray(iso *Isolate, length int) *Array + func (a *Array) Length() uint32 + type CPUProfile struct + func (c *CPUProfile) Delete() + func (c *CPUProfile) GetDuration() time.Duration + func (c *CPUProfile) GetTitle() string + func (c *CPUProfile) GetTopDownRoot() *CPUProfileNode + type CPUProfileNode struct + func (c *CPUProfileNode) GetBailoutReason() string + func (c *CPUProfileNode) GetChild(index int) *CPUProfileNode + func (c *CPUProfileNode) GetChildrenCount() int + func (c *CPUProfileNode) GetColumnNumber() int + func (c *CPUProfileNode) GetFunctionName() string + func (c *CPUProfileNode) GetHitCount() int + func (c *CPUProfileNode) GetLineNumber() int + func (c *CPUProfileNode) GetNodeId() int + func (c *CPUProfileNode) GetParent() *CPUProfileNode + func (c *CPUProfileNode) GetScriptId() int + func (c *CPUProfileNode) GetScriptResourceName() string + type CPUProfiler struct + func NewCPUProfiler(iso *Isolate) *CPUProfiler + func (c *CPUProfiler) Dispose() + func (c *CPUProfiler) StartProfiling(title string) + func (c *CPUProfiler) StopProfiling(title string) *CPUProfile + type CompileMode C.int + type CompileOptions struct + CachedData *CompilerCachedData + Mode CompileMode + type CompilerCachedData struct + Bytes []byte + Rejected bool + type Context struct + func NewContext(opt ...ContextOption) *Context + func (c *Context) Close() + func (c *Context) Global() *Object + func (c *Context) Isolate() *Isolate + func (c *Context) NewArray(length int) *Array + func (c *Context) NewObject() *Object + func (c *Context) NewValue(val interface{}) (*Value, error) + func (c *Context) PerformMicrotaskCheckpoint() + func (c *Context) RunScript(source string, origin string) (*Value, error) + func (c *Context) WithTemporaryValues(callback func()) + type ContextOption interface + type Function struct + func (fn *Function) Call(recv Valuer, args ...Valuer) (*Value, error) + func (fn *Function) NewInstance(args ...Valuer) (*Object, error) + func (fn *Function) SourceMapUrl() *Value + type FunctionCallback func(info *FunctionCallbackInfo) *Value + type FunctionCallbackInfo struct + func (i *FunctionCallbackInfo) Args() []*Value + func (i *FunctionCallbackInfo) Context() *Context + func (i *FunctionCallbackInfo) This() *Object + type FunctionTemplate struct + func NewFunctionTemplate(iso *Isolate, callback FunctionCallback) *FunctionTemplate + func (t FunctionTemplate) Set(name string, val interface{}, attributes ...PropertyAttribute) error + func (tmpl *FunctionTemplate) GetFunction(ctx *Context) *Function + 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 + func NewIsolateWith(initialHeap uint64, maxHeap uint64) *Isolate + func (i *Isolate) Close() + func (i *Isolate) CompileUnboundScript(source, origin string, opts CompileOptions) (*UnboundScript, error) + func (i *Isolate) Dispose() + func (i *Isolate) GetHeapStatistics() HeapStatistics + func (i *Isolate) IsExecutionTerminating() bool + func (i *Isolate) Lock() + func (i *Isolate) TerminateExecution() + func (i *Isolate) ThrowException(value *Value) *Value + func (i *Isolate) Unlock() + 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 NewObject(iso *Isolate) *Object + func (o *Object) Delete(key string) bool + func (o *Object) DeleteIdx(idx uint32) bool + func (o *Object) DeleteKey(key *Value) bool + func (o *Object) Get(key string) (*Value, error) + func (o *Object) GetIdx(idx uint32) (*Value, error) + func (o *Object) GetInternalField(idx uint32) *Value + func (o *Object) GetKey(key *Value) (*Value, error) + func (o *Object) Has(key string) bool + func (o *Object) HasIdx(idx uint32) bool + func (o *Object) HasKey(key *Value) bool + func (o *Object) InternalFieldCount() uint32 + func (o *Object) MethodCall(methodName string, args ...Valuer) (*Value, error) + func (o *Object) Set(key string, val interface{}) error + func (o *Object) SetIdx(idx uint32, val interface{}) error + func (o *Object) SetInternalField(idx uint32, val interface{}) error + func (o *Object) SetKey(key *Value, val interface{}) error + type ObjectTemplate struct + func NewObjectTemplate(iso *Isolate) *ObjectTemplate + func (o *ObjectTemplate) InternalFieldCount() uint32 + func (o *ObjectTemplate) NewInstance(ctx *Context) (*Object, error) + func (o *ObjectTemplate) SetInternalFieldCount(fieldCount uint32) + func (t ObjectTemplate) Set(name string, val interface{}, attributes ...PropertyAttribute) error + type Promise struct + func (p *Promise) Catch(cb FunctionCallback) *Promise + func (p *Promise) Result() *Value + func (p *Promise) State() PromiseState + func (p *Promise) Then(cbs ...FunctionCallback) *Promise + 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 UnboundScript struct + func (u *UnboundScript) CreateCodeCache() *CompilerCachedData + func (u *UnboundScript) Run(ctx *Context) (*Value, error) + type Value struct + func JSONParse(ctx *Context, str string) (*Value, error) + func NewValue(iso *Isolate, val interface{}) (*Value, error) + func Null(iso *Isolate) *Value + func Undefined(iso *Isolate) *Value + func (v *Value) ArrayIndex() (idx uint32, ok bool) + func (v *Value) AsArray() (*Array, error) + 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) GetType() ValueType + 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) SameValue(other *Value) bool + func (v *Value) String() string + func (v *Value) Uint32() uint32 + type ValueType int8 + const BigIntType + const FalseType + const FunctionType + const NullType + const NumberType + const ObjectType + const OtherType + const StringType + const SymbolType + const TrueType + const UndefinedType + type Valuer interface