Versions in this module Expand all Collapse all v1 v1.0.0 Oct 2, 2019 Changes in this version + const BoolSize + const EmptySize + const IntSize + const NumberSize + var ErrMaxDepth = errors.New("reached max depth") + var ErrVersion = errors.New("version mismatch") + func Run(src interface{}) (*Otto, Value, error) + type Context struct + Callee string + Column int + Filename string + Line int + Stacktrace []string + Symbols map[string]Value + This Value + type Error struct + func (err Error) Error() string + func (err Error) Name() string + func (err Error) NativeError() error + func (err Error) String() string + type FunctionCall struct + ArgumentList []Value + Otto *Otto + This Value + func (self FunctionCall) Argument(index int) Value + func (self FunctionCall) CallerLocation() string + func (self FunctionCall) Context() context.Context + type MemUsageContext struct + func NewMemUsageContext(maxDepth int, nativeChecker NativeMemUsageChecker) *MemUsageContext + func (dt MemUsageContext) Ascend() + func (dt MemUsageContext) Depth() int + func (dt MemUsageContext) Descend() error + func (vt MemUsageContext) IsObjVisited(obj *_object) bool + func (vt MemUsageContext) IsStashVisited(stash _stash) bool + func (vt MemUsageContext) VisitObj(obj *_object) + func (vt MemUsageContext) VisitStash(stash _stash) + type NativeClass struct + Function Value + InstanceOf func(value interface{}) Value + type NativeMemUsageChecker interface + NativeMemUsage func(goNativeValue interface{}) (uint64, bool) + type Object struct + func (self Object) Call(name string, argumentList ...interface{}) (Value, error) + func (self Object) Class() string + func (self Object) Get(name string) (Value, error) + func (self Object) Keys() []string + func (self Object) KeysByParent() [][]string + func (self Object) Set(name string, value interface{}) error + func (self Object) Value() Value + type Otto struct + Interrupt chan func() + func New() *Otto + func NewWithContext(ctx goctx.Context) *Otto + func (in *Otto) Copy() *Otto + func (otto *Otto) MemUsage(ctx *MemUsageContext) (uint64, error) + func (self *Otto) Compile(filename string, src interface{}) (*Script, error) + func (self *Otto) CompileWithSourceMap(filename string, src, sm interface{}) (*Script, error) + func (self Otto) Call(source string, this interface{}, argumentList ...interface{}) (Value, error) + func (self Otto) CallWithContext(ctx goctx.Context, source string, this interface{}, ...) (Value, error) + func (self Otto) Context() Context + func (self Otto) ContextLimit(limit int) Context + func (self Otto) ContextSkip(limit int, skipNative bool) (ctx Context) + func (self Otto) CreateNativeClass(className string, ctor func(call FunctionCall) interface{}, ...) NativeClass + func (self Otto) CreateNativeError(name string) (Value, func(err error) Value) + func (self Otto) CreateNativeErrorClass(className string, ctor func(call FunctionCall) error, ...) NativeClass + func (self Otto) CreateNativeFunction(name, file string, line int, call func(FunctionCall) Value) (Value, error) + func (self Otto) Eval(src interface{}) (Value, error) + func (self Otto) EvalWithContext(ctx goctx.Context, src interface{}) (Value, error) + func (self Otto) Get(name string) (Value, error) + func (self Otto) GoContext() goctx.Context + func (self Otto) MakeCustomError(name, message string) Value + func (self Otto) MakeRangeError(message string) Value + func (self Otto) MakeSyntaxError(message string) Value + func (self Otto) MakeTypeError(message string) Value + func (self Otto) Object(source string) (*Object, error) + func (self Otto) Run(src interface{}) (Value, error) + func (self Otto) Set(name string, value interface{}) error + func (self Otto) SetDebuggerHandler(fn func(vm *Otto)) + func (self Otto) SetRandomSource(fn func() float64) + func (self Otto) SetStackDepthLimit(limit int) + func (self Otto) SetStackTraceLimit(limit int) + func (self Otto) ToValue(value interface{}) (Value, error) + type Property struct + Name string + Value Value + type Script struct + func (self *Script) String() string + type Value struct + func FalseValue() Value + func NaNValue() Value + func NullValue() Value + func ToValue(value interface{}) (Value, error) + func TrueValue() Value + func UndefinedValue() Value + func (self Value) Export() (interface{}, error) + func (self Value) IsNative() bool + func (self Value) MemUsage(ctx *MemUsageContext) (uint64, error) + func (value Value) Call(this Value, argumentList ...interface{}) (Value, error) + func (value Value) CallWithContext(ctx context.Context, this Value, argumentList ...interface{}) (Value, error) + func (value Value) Class() string + func (value Value) IsBoolean() bool + func (value Value) IsDefined() bool + func (value Value) IsFunction() bool + func (value Value) IsNaN() bool + func (value Value) IsNull() bool + func (value Value) IsNumber() bool + func (value Value) IsObject() bool + func (value Value) IsPrimitive() bool + func (value Value) IsString() bool + func (value Value) IsUndefined() bool + func (value Value) Object() *Object + func (value Value) String() string + func (value Value) ToBoolean() (bool, error) + func (value Value) ToFloat() (float64, error) + func (value Value) ToInteger() (int64, error) + func (value Value) ToString() (string, error)