Documentation
¶
Index ¶
- Variables
- func DisableAllocationStackTraces()
- func DumpTracer(w io.Writer, allocations bool)
- func EnableAllocationStackTraces()
- func Initialize()
- func StartTracer(t TracerType)
- func StopTracer(t TracerType)
- func TracerHandler() http.Handler
- type CallerInfo
- type Context
- func (c *Context) Create(v interface{}) (*Value, error)
- func (c *Context) False() (*Value, error)
- func (c *Context) GetIsolate() *Isolate
- func (c *Context) Global() (*Value, error)
- func (c *Context) NewFunctionTemplate(cb Function) (*FunctionTemplate, error)
- func (c *Context) NewResolver() (*Resolver, error)
- func (c *Context) Null() (*Value, error)
- func (c *Context) ParseJSON(json string) (*Value, error)
- func (c *Context) Run(code string, filename string) (*Value, error)
- func (c *Context) True() (*Value, error)
- func (c *Context) Undefined() (*Value, error)
- type Function
- type FunctionArgs
- type FunctionTemplate
- func (f *FunctionTemplate) GetFunction() (*Value, error)
- func (f *FunctionTemplate) GetInstanceTemplate() (*ObjectTemplate, error)
- func (f *FunctionTemplate) GetPrototypeTemplate() (*ObjectTemplate, error)
- func (f *FunctionTemplate) Inherit(parent *FunctionTemplate) error
- func (f *FunctionTemplate) SetHiddenPrototype(value bool) error
- func (f *FunctionTemplate) SetName(name string) error
- type Getter
- type GetterArgs
- type HeapStatistics
- type Inspector
- type InspectorCallbacks
- type Isolate
- func (i *Isolate) AddShutdownHook(shutdownHook interface{})
- func (i *Isolate) GetData(key string) interface{}
- func (i *Isolate) GetHeapStatistics() (HeapStatistics, error)
- func (i *Isolate) IsRunning() bool
- func (i *Isolate) NewContext() (*Context, error)
- func (i *Isolate) NewInspector(callbacks InspectorCallbacks) *Inspector
- func (i *Isolate) RequestGarbageCollectionForTesting()
- func (i *Isolate) SendLowMemoryNotification()
- func (i *Isolate) SetData(key string, value interface{})
- func (i *Isolate) Terminate()
- type Kind
- type Marshaler
- type ObjectTemplate
- type PromiseState
- type PropertyDescriptor
- type Resolver
- type Setter
- type SetterArgs
- type Snapshot
- type TracerType
- type Value
- func (v *Value) Bind(argv ...*Value) (*Value, error)
- func (v *Value) Bool() (bool, error)
- func (v *Value) Bytes() ([]byte, error)
- func (v *Value) Call(self *Value, argv ...*Value) (*Value, error)
- func (v *Value) CallMethod(name string, argv ...*Value) (*Value, error)
- func (v *Value) Date() (time.Time, error)
- func (v *Value) DefineProperty(key string, descriptor *PropertyDescriptor) error
- func (v *Value) Float64() (float64, error)
- func (v *Value) Get(key string) (*Value, error)
- func (v *Value) GetContext() *Context
- func (v *Value) GetIndex(i int) (*Value, error)
- func (v *Value) GetInternalField(i int) (int64, error)
- func (v *Value) GetInternalFieldCount() (int, error)
- func (v *Value) Int64() (int64, error)
- func (v *Value) IsKind(k Kind) bool
- func (v *Value) MarshalJSON() ([]byte, error)
- func (v *Value) New(argv ...*Value) (*Value, error)
- func (v *Value) PromiseInfo() (PromiseState, *Value, error)
- func (v *Value) Receiver(t reflect.Type) *reflect.Value
- func (v *Value) Set(key string, value *Value) error
- func (v *Value) SetIndex(i int, value *Value) error
- func (v *Value) SetInternalField(i int, value uint32) error
- func (v *Value) SetReceiver(value *reflect.Value)
- func (v *Value) String() string
- func (v *Value) Unmarshal(t reflect.Type) (*reflect.Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = struct{ Major, Minor, Build, Patch int }{ Major: int(C.version.major), Minor: int(C.version.minor), Build: int(C.version.build), Patch: int(C.version.patch), }
Version exposes the compiled-in version of the linked V8 library. This can be used to test for specific javascript functionality support (e.g. ES6 destructuring isn't supported before major version 5.).
Functions ¶
func DisableAllocationStackTraces ¶
func DisableAllocationStackTraces()
func DumpTracer ¶
func EnableAllocationStackTraces ¶
func EnableAllocationStackTraces()
func Initialize ¶
func Initialize()
func StartTracer ¶
func StartTracer(t TracerType)
func StopTracer ¶
func StopTracer(t TracerType)
func TracerHandler ¶
Types ¶
type Context ¶
func (*Context) GetIsolate ¶
func (*Context) NewFunctionTemplate ¶
func (c *Context) NewFunctionTemplate(cb Function) (*FunctionTemplate, error)
func (*Context) NewResolver ¶
type Function ¶
type Function func(FunctionArgs) (*Value, error)
type FunctionArgs ¶
type FunctionArgs struct { Context *Context Caller CallerInfo This *Value Holder *Value IsConstructCall bool Args []*Value }
func (*FunctionArgs) Arg ¶
func (c *FunctionArgs) Arg(n int) *Value
type FunctionTemplate ¶
func (*FunctionTemplate) GetFunction ¶
func (f *FunctionTemplate) GetFunction() (*Value, error)
func (*FunctionTemplate) GetInstanceTemplate ¶
func (f *FunctionTemplate) GetInstanceTemplate() (*ObjectTemplate, error)
func (*FunctionTemplate) GetPrototypeTemplate ¶
func (f *FunctionTemplate) GetPrototypeTemplate() (*ObjectTemplate, error)
func (*FunctionTemplate) Inherit ¶
func (f *FunctionTemplate) Inherit(parent *FunctionTemplate) error
func (*FunctionTemplate) SetHiddenPrototype ¶
func (f *FunctionTemplate) SetHiddenPrototype(value bool) error
func (*FunctionTemplate) SetName ¶
func (f *FunctionTemplate) SetName(name string) error
type Getter ¶
type Getter func(GetterArgs) (*Value, error)
type GetterArgs ¶
type GetterArgs struct { Context *Context Caller CallerInfo This *Value Holder *Value Key string }
type HeapStatistics ¶
type Inspector ¶
type Inspector struct {
// contains filtered or unexported fields
}
func (*Inspector) AddContext ¶
func (*Inspector) DispatchMessage ¶
func (*Inspector) RemoveContext ¶
type InspectorCallbacks ¶
type Isolate ¶
func NewIsolate ¶
func NewIsolate() *Isolate
func NewIsolateWithSnapshot ¶
func (*Isolate) AddShutdownHook ¶
func (i *Isolate) AddShutdownHook(shutdownHook interface{})
func (*Isolate) GetHeapStatistics ¶
func (i *Isolate) GetHeapStatistics() (HeapStatistics, error)
func (*Isolate) NewContext ¶
func (*Isolate) NewInspector ¶
func (i *Isolate) NewInspector(callbacks InspectorCallbacks) *Inspector
func (*Isolate) RequestGarbageCollectionForTesting ¶
func (i *Isolate) RequestGarbageCollectionForTesting()
func (*Isolate) SendLowMemoryNotification ¶
func (i *Isolate) SendLowMemoryNotification()
type Kind ¶
type Kind uint8
Kind is an underlying V8 representation of a *Value. Javascript values may have multiple underyling kinds. For example, a function will be both KindObject and KindFunction.
const ( KindUndefined Kind = iota KindNull KindName KindString KindSymbol KindFunction KindArray KindObject KindBoolean KindNumber KindExternal KindInt32 KindUint32 KindDate KindArgumentsObject KindBooleanObject KindNumberObject KindStringObject KindSymbolObject KindNativeError KindRegExp KindAsyncFunction KindGeneratorFunction KindGeneratorObject KindPromise KindMap KindSet KindMapIterator KindSetIterator KindWeakMap KindWeakSet KindArrayBuffer KindArrayBufferView KindTypedArray KindUint8Array KindUint8ClampedArray KindInt8Array KindUint16Array KindInt16Array KindUint32Array KindInt32Array KindFloat32Array KindFloat64Array KindDataView KindProxy KindWebAssemblyCompiledModule )
type ObjectTemplate ¶
func (*ObjectTemplate) SetAccessor ¶
func (o *ObjectTemplate) SetAccessor(name string, getter Getter, setter Setter) error
func (*ObjectTemplate) SetInternalFieldCount ¶
func (o *ObjectTemplate) SetInternalFieldCount(count int) error
type PromiseState ¶
type PromiseState uint8
PromiseState defines the state of a promise: either pending, resolved, or rejected. Promises that are pending have no result value yet. A promise that is resolved has a result value, and a promise that is rejected has a result value that is usually the error.
const ( PromiseStatePending PromiseState = iota PromiseStateResolved PromiseStateRejected )
func (PromiseState) String ¶
func (s PromiseState) String() string
type PropertyDescriptor ¶
type Setter ¶
type Setter func(SetterArgs) error
type SetterArgs ¶
type Snapshot ¶
type Snapshot struct {
// contains filtered or unexported fields
}
func CreateSnapshot ¶
func ImportSnapshot ¶
type Value ¶
func (*Value) DefineProperty ¶
func (v *Value) DefineProperty(key string, descriptor *PropertyDescriptor) error
func (*Value) GetContext ¶
func (*Value) GetInternalFieldCount ¶
func (*Value) MarshalJSON ¶
func (*Value) PromiseInfo ¶
func (v *Value) PromiseInfo() (PromiseState, *Value, error)
func (*Value) SetReceiver ¶
Click to show internal directories.
Click to hide internal directories.