quickjs

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

func (*Context) Array

func (c *Context) Array() Value

func (*Context) ArrayBuffer

func (c *Context) ArrayBuffer(data []byte) Value

func (*Context) BigInt

func (c *Context) BigInt(v int64) Value

func (*Context) Bool

func (c *Context) Bool(v bool) Value

func (*Context) Close

func (c *Context) Close() error

func (*Context) Date

func (c *Context) Date(epochMs float64) Value

func (*Context) Eval

func (c *Context) Eval(code string) (Value, error)

func (*Context) EvalFile

func (c *Context) EvalFile(code, filename string) (Value, error)

func (*Context) EvalModule

func (c *Context) EvalModule(code, filename string) (Value, error)

func (*Context) EvalToString

func (c *Context) EvalToString(code, filename string) (string, error)

func (*Context) Float64

func (c *Context) Float64(v float64) Value

func (*Context) Function

func (c *Context) Function(name string, fn GoFunc) Value

func (*Context) GetGlobal

func (c *Context) GetGlobal(name string) (Value, error)

func (*Context) Global

func (c *Context) Global() (Value, error)

func (*Context) Int32

func (c *Context) Int32(v int32) Value

func (*Context) Int64

func (c *Context) Int64(v int64) Value

func (*Context) Null

func (c *Context) Null() Value

func (*Context) Object

func (c *Context) Object() Value

func (*Context) ParseJSON

func (c *Context) ParseJSON(json string) (Value, error)

func (*Context) SetGlobal

func (c *Context) SetGlobal(name string, val Value) error

func (*Context) String

func (c *Context) String(s string) Value

func (*Context) ThrowError

func (c *Context) ThrowError(msg string) Value

func (*Context) ThrowTypeError

func (c *Context) ThrowTypeError(msg string) Value

func (*Context) Undefined

func (c *Context) Undefined() Value

type EvalFlag

type EvalFlag int32
const (
	EvalGlobal EvalFlag = 0

	EvalModule EvalFlag = 1 << 0
)

type GoFunc

type GoFunc func(ctx *Context, this Value, args []Value) Value

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime() (*Runtime, error)

func NewRuntimeWithContext

func NewRuntimeWithContext(ctx context.Context) (*Runtime, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) ExecutePendingJobs

func (r *Runtime) ExecutePendingJobs() (int, error)

func (*Runtime) ForceClose

func (r *Runtime) ForceClose() error

func (*Runtime) NewContext

func (r *Runtime) NewContext() (*Context, error)

func (*Runtime) RunGC

func (r *Runtime) RunGC() error

func (*Runtime) SetLogFunc

func (r *Runtime) SetLogFunc(fn func(msg string))

func (*Runtime) SetMaxStackSize

func (r *Runtime) SetMaxStackSize(size uint32) error

func (*Runtime) SetMemoryLimit

func (r *Runtime) SetMemoryLimit(limit uint32) error

type Value

type Value struct {
	// contains filtered or unexported fields
}

func (Value) BigInt

func (v Value) BigInt() (int64, error)

func (Value) Bool

func (v Value) Bool() bool

func (Value) Bytes

func (v Value) Bytes() ([]byte, error)

func (Value) Call

func (v Value) Call(this Value, args ...Value) (Value, error)

func (Value) CallMethod

func (v Value) CallMethod(method string, args ...Value) (Value, error)

func (Value) Delete

func (v Value) Delete(prop string) error

func (Value) Float64

func (v Value) Float64() (float64, error)

func (Value) Get

func (v Value) Get(prop string) (Value, error)

func (Value) GetIdx

func (v Value) GetIdx(idx int) (Value, error)

func (Value) Has

func (v Value) Has(prop string) bool

func (Value) Instanceof

func (v Value) Instanceof(ctor Value) bool

func (Value) Int32

func (v Value) Int32() (int32, error)

func (Value) Int64

func (v Value) Int64() (int64, error)

func (Value) IsArray

func (v Value) IsArray() bool

func (Value) IsBigInt

func (v Value) IsBigInt() bool

func (Value) IsBool

func (v Value) IsBool() bool

func (Value) IsDate

func (v Value) IsDate() bool

func (Value) IsError

func (v Value) IsError() bool

func (Value) IsFunction

func (v Value) IsFunction() bool

func (Value) IsNull

func (v Value) IsNull() bool

func (Value) IsNumber

func (v Value) IsNumber() bool

func (Value) IsObject

func (v Value) IsObject() bool

func (Value) IsPromise

func (v Value) IsPromise() bool

func (Value) IsString

func (v Value) IsString() bool

func (Value) IsSymbol

func (v Value) IsSymbol() bool

func (Value) IsUndefined

func (v Value) IsUndefined() bool

func (Value) JSONStringify

func (v Value) JSONStringify() (string, error)

func (Value) Len

func (v Value) Len() int

func (Value) New

func (v Value) New(args ...Value) (Value, error)

func (Value) Set

func (v Value) Set(prop string, val Value) error

func (Value) SetIdx

func (v Value) SetIdx(idx int, val Value) error

func (Value) String

func (v Value) String() string

func (Value) Typeof

func (v Value) Typeof() string

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL