Documentation ¶
Index ¶
- Constants
- func AddIntrinsicConsole(r realmConfig) error
- func AddIntrinsicTimeout(r realmConfig) error
- func DefinePropertyNoExotic(c *propertyConfig) error
- func DefinePropertyThrow(c *propertyConfig) error
- func EvalOptionBacktraceBarrier(c *evalConfig)
- func EvalOptionStrict(c *evalConfig)
- func EvalOptionStrip(c *evalConfig)
- func NewInternalError(format string, v ...interface{}) error
- func NewRangeError(format string, v ...interface{}) error
- func NewReferenceError(format string, v ...interface{}) error
- func NewSyntaxError(format string, v ...interface{}) error
- func NewTypeError(format string, v ...interface{}) error
- type AsyncResult
- type Atom
- type DefinePropertyOption
- func DefinePropertyConfigurable(b bool) DefinePropertyOption
- func DefinePropertyEnumerable(b bool) DefinePropertyOption
- func DefinePropertyGetter(getter interface{}) DefinePropertyOption
- func DefinePropertySetter(setter interface{}) DefinePropertyOption
- func DefinePropertyValue(v interface{}) DefinePropertyOption
- func DefinePropertyWritable(b bool) DefinePropertyOption
- type Error
- type EvalOption
- type Function
- type InternalError
- type InvalidParameterTypeError
- type InvalidTypeError
- type JSValuer
- type Literal
- type NotEnoughParametersError
- type RangeError
- type Realm
- func (r *Realm) Convert(v interface{}) (*Value, error)
- func (r *Realm) Eval(script string, opts ...EvalOption) (*Value, error)
- func (r *Realm) EvalBinary(buf []byte) (*Value, error)
- func (r *Realm) EvalFile(file string, opts ...EvalOption) (*Value, error)
- func (r *Realm) EvalModule(script string, opts ...EvalOption) (*Value, error)
- func (r *Realm) EvalModuleFile(file string, opts ...EvalOption) (*Value, error)
- func (r *Realm) GlobalObject() (*Value, error)
- func (r *Realm) LoadValue(buf []byte) (*Value, error)
- func (r *Realm) NewArrayBuffer(data []byte) (*Value, error)
- func (r *Realm) NewBoolean(b bool) (*Value, error)
- func (r *Realm) NewFloat(n float64) (*Value, error)
- func (r *Realm) NewFunction(f interface{}) (*Value, error)
- func (r *Realm) NewInt(n int) (*Value, error)
- func (r *Realm) NewObject() (*Value, error)
- func (r *Realm) NewObjectProto(proto *Value) (*Value, error)
- func (r *Realm) NewObjectWithFinalizer(f func()) (*Value, error)
- func (r *Realm) NewString(s string) (*Value, error)
- func (r *Realm) NewStringAtom(s string) *Atom
- func (r *Realm) ParseJSON(data string, filename string) (*Value, error)
- func (r *Realm) SetConstructor(funcObj, proto *Value)
- func (r *Realm) SetConstructorBit(obj *Value, val bool)
- type RealmOption
- type ReferenceError
- type Runtime
- func (rt *Runtime) Compile(script, filename string, opts ...EvalOption) ([]byte, error)
- func (rt *Runtime) CompileFile(file string, opts ...EvalOption) ([]byte, error)
- func (rt *Runtime) CompileModule(script, filename string, opts ...EvalOption) ([]byte, error)
- func (rt *Runtime) CompileModuleFile(file string, opts ...EvalOption) ([]byte, error)
- func (rt *Runtime) EvalBinaryNodeModule(buf []byte) (*Value, error)
- func (rt *Runtime) EvalNodeModule(script string, opts ...EvalOption) (*Value, error)
- func (rt *Runtime) EvalNodeModuleFile(file string, opts ...EvalOption) (*Value, error)
- func (rt *Runtime) HasAsyncTasks() bool
- func (rt *Runtime) NewRealm(opts ...RealmOption) (*Realm, error)
- func (rt *Runtime) ParseJSON(data string, filename string) (*Value, error)
- func (rt *Runtime) StartEventLoop(ctx context.Context, waitForever bool) error
- type SyntaxError
- type Tag
- type TypeError
- type TypedValue
- type Value
- func (v *Value) Bytes() []byte
- func (v *Value) Call(thisObject *Value, args ...interface{}) (*Value, error)
- func (v *Value) CallAsync(thisObject *Value, args ...interface{}) <-chan *AsyncResult
- func (v *Value) CallValues(thisObject *Value, args []*Value) (*Value, error)
- func (v *Value) CallValuesAsync(thisObject *Value, args []*Value) <-chan *AsyncResult
- func (v *Value) Construct(args ...interface{}) (*Value, error)
- func (v *Value) DefineProperty(prop string, opts ...DefinePropertyOption) (bool, error)
- func (v *Value) DefinePropertyAtom(prop *Atom, opts ...DefinePropertyOption) (bool, error)
- func (v *Value) Get(property string) (*Value, error)
- func (v *Value) GetAtom(atom *Atom) (*Value, error)
- func (v *Value) Index(index int) (*Value, error)
- func (v *Value) Interface() interface{}
- func (v *Value) Invoke(name string, args ...interface{}) (*Value, error)
- func (v *Value) InvokeAsync(name string, args ...interface{}) <-chan *AsyncResult
- func (v *Value) InvokeValues(name string, args []*Value) (*Value, error)
- func (v *Value) InvokeValuesAsync(name string, args []*Value) <-chan *AsyncResult
- func (v *Value) IsArray() bool
- func (v *Value) IsFloat() bool
- func (v *Value) IsFunction() bool
- func (v *Value) IsInt() bool
- func (v *Value) IsNumber() bool
- func (v *Value) IsObject() bool
- func (v *Value) IsString() bool
- func (v *Value) IsSymbol() bool
- func (v *Value) IsTruthy() (bool, error)
- func (v *Value) OwnPropertyNames() []*Atom
- func (v *Value) Set(prop string, val interface{}) (bool, error)
- func (v *Value) String() string
- func (v *Value) Tag() Tag
- func (v *Value) ToBool() bool
- func (v *Value) ToFloat() float64
- func (v *Value) ToInt() int
- func (v *Value) ToString() string
Constants ¶
View Source
const ( TagBigDecimal = Tag(internal.TagBigDecimal) TagBigInt = Tag(internal.TagBigInt) TagBigFloat = Tag(internal.TagBigFloat) TagSymbol = Tag(internal.TagSymbol) TagString = Tag(internal.TagString) TagObject = Tag(internal.TagObject) TagInt = Tag(internal.TagInt) TagBool = Tag(internal.TagBool) TagNull = Tag(internal.TagNull) TagUndefined = Tag(internal.TagUndefined) TagUninitialized = Tag(internal.TagUninitialized) TagCatchOffset = Tag(internal.TagCatchOffset) TagException = Tag(internal.TagException) TagFloat64 = Tag(internal.TagFloat64) )
Variables ¶
This section is empty.
Functions ¶
func AddIntrinsicConsole ¶
func AddIntrinsicConsole(r realmConfig) error
func AddIntrinsicTimeout ¶
func AddIntrinsicTimeout(r realmConfig) error
func DefinePropertyNoExotic ¶
func DefinePropertyNoExotic(c *propertyConfig) error
func DefinePropertyThrow ¶
func DefinePropertyThrow(c *propertyConfig) error
func EvalOptionBacktraceBarrier ¶
func EvalOptionBacktraceBarrier(c *evalConfig)
func EvalOptionStrict ¶
func EvalOptionStrict(c *evalConfig)
func EvalOptionStrip ¶
func EvalOptionStrip(c *evalConfig)
func NewInternalError ¶
func NewRangeError ¶
func NewReferenceError ¶
func NewSyntaxError ¶
func NewTypeError ¶
Types ¶
type AsyncResult ¶
type Atom ¶
type Atom struct {
// contains filtered or unexported fields
}
func (*Atom) ToStringValue ¶
type DefinePropertyOption ¶
func DefinePropertyConfigurable ¶
func DefinePropertyConfigurable(b bool) DefinePropertyOption
func DefinePropertyEnumerable ¶
func DefinePropertyEnumerable(b bool) DefinePropertyOption
func DefinePropertyGetter ¶
func DefinePropertyGetter(getter interface{}) DefinePropertyOption
func DefinePropertySetter ¶
func DefinePropertySetter(setter interface{}) DefinePropertyOption
func DefinePropertyValue ¶
func DefinePropertyValue(v interface{}) DefinePropertyOption
func DefinePropertyWritable ¶
func DefinePropertyWritable(b bool) DefinePropertyOption
type EvalOption ¶
type EvalOption func(*evalConfig)
type InternalError ¶
type InternalError string
func (InternalError) Error ¶
func (e InternalError) Error() string
type InvalidParameterTypeError ¶
func (*InvalidParameterTypeError) Error ¶
func (e *InvalidParameterTypeError) Error() string
type InvalidTypeError ¶
func (*InvalidTypeError) Error ¶
func (e *InvalidTypeError) Error() string
type NotEnoughParametersError ¶
type NotEnoughParametersError struct {
Required, Actual int
}
func (*NotEnoughParametersError) Error ¶
func (e *NotEnoughParametersError) Error() string
type RangeError ¶
type RangeError string
func (RangeError) Error ¶
func (e RangeError) Error() string
type Realm ¶
type Realm struct {
// contains filtered or unexported fields
}
Realm is a distinct global environment.
See https://github.com/tc39/proposal-realms.
func (*Realm) EvalModule ¶
func (r *Realm) EvalModule(script string, opts ...EvalOption) (*Value, error)
func (*Realm) EvalModuleFile ¶
func (r *Realm) EvalModuleFile(file string, opts ...EvalOption) (*Value, error)
func (*Realm) GlobalObject ¶
func (*Realm) NewFunction ¶
func (*Realm) NewObjectWithFinalizer ¶
func (*Realm) NewStringAtom ¶
func (*Realm) SetConstructor ¶
func (*Realm) SetConstructorBit ¶
type RealmOption ¶
type RealmOption func(r realmConfig) error
func AddIntrinsicConsoleWithLogger ¶
func AddIntrinsicConsoleWithLogger(l *log.Logger) RealmOption
type ReferenceError ¶
type ReferenceError string
func (ReferenceError) Error ¶
func (e ReferenceError) Error() string
type Runtime ¶
type Runtime struct {
// contains filtered or unexported fields
}
func NewRuntime ¶
func NewRuntime(defaultRealmOptions ...RealmOption) *Runtime
func (*Runtime) Compile ¶
func (rt *Runtime) Compile(script, filename string, opts ...EvalOption) ([]byte, error)
func (*Runtime) CompileFile ¶
func (rt *Runtime) CompileFile(file string, opts ...EvalOption) ([]byte, error)
func (*Runtime) CompileModule ¶
func (rt *Runtime) CompileModule(script, filename string, opts ...EvalOption) ([]byte, error)
func (*Runtime) CompileModuleFile ¶
func (rt *Runtime) CompileModuleFile(file string, opts ...EvalOption) ([]byte, error)
func (*Runtime) EvalBinaryNodeModule ¶
func (*Runtime) EvalNodeModule ¶
func (rt *Runtime) EvalNodeModule(script string, opts ...EvalOption) (*Value, error)
func (*Runtime) EvalNodeModuleFile ¶
func (rt *Runtime) EvalNodeModuleFile(file string, opts ...EvalOption) (*Value, error)
func (*Runtime) HasAsyncTasks ¶
type SyntaxError ¶
type SyntaxError string
func (SyntaxError) Error ¶
func (e SyntaxError) Error() string
type Value ¶
type Value struct {
// contains filtered or unexported fields
}
func NewBoolean ¶
func NewUndefined ¶
func NewUndefined() *Value
func (*Value) CallAsync ¶
func (v *Value) CallAsync(thisObject *Value, args ...interface{}) <-chan *AsyncResult
func (*Value) CallValues ¶
func (*Value) CallValuesAsync ¶
func (v *Value) CallValuesAsync(thisObject *Value, args []*Value) <-chan *AsyncResult
func (*Value) DefineProperty ¶
func (v *Value) DefineProperty(prop string, opts ...DefinePropertyOption) (bool, error)
func (*Value) DefinePropertyAtom ¶
func (v *Value) DefinePropertyAtom(prop *Atom, opts ...DefinePropertyOption) (bool, error)
func (*Value) InvokeAsync ¶
func (v *Value) InvokeAsync(name string, args ...interface{}) <-chan *AsyncResult
func (*Value) InvokeValues ¶
func (*Value) InvokeValuesAsync ¶
func (v *Value) InvokeValuesAsync(name string, args []*Value) <-chan *AsyncResult
func (*Value) IsFunction ¶
func (*Value) OwnPropertyNames ¶
Click to show internal directories.
Click to hide internal directories.