v1.17.2 Latest Latest

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

Go to latest
Published: Apr 19, 2022 License: BSD-2-Clause Imports: 3 Imported by: 0


Rendered for js/wasm



This section is empty.


This section is empty.


func CopyBytesToGo added in v1.17.2

func CopyBytesToGo(dst []byte, src Value) int

CopyBytesToGo copies bytes from the Uint8Array src to dst. It returns the number of bytes copied, which will be the minimum of the lengths of src and dst. CopyBytesToGo panics if src is not an Uint8Array.

func CopyBytesToJS added in v1.17.2

func CopyBytesToJS(dst Value, src []byte) int

CopyBytesToJS copies bytes from src to the Uint8Array dst. It returns the number of bytes copied, which will be the minimum of the lengths of src and dst. CopyBytesToJS panics if dst is not an Uint8Array.


type Error

type Error struct {

func (Error) Error

func (e Error) Error() string

type Func

type Func struct {

func FuncOf

func FuncOf(fn func(this Value, args []Value) interface{}) Func

func (Func) Release

func (f Func) Release()

type Type

type Type int
const (
	TypeUndefined Type = iota

func (Type) String

func (t Type) String() string

type Value

type Value struct {
	// contains filtered or unexported fields

func Global

func Global() Value

func Null

func Null() Value

func Undefined

func Undefined() Value

func ValueOf

func ValueOf(x interface{}) Value

func (Value) Bool

func (v Value) Bool() bool

func (Value) Call

func (v Value) Call(m string, args ...interface{}) Value

func (Value) Delete added in v1.17.2

func (v Value) Delete(p string)

Delete deletes the JavaScript property p of value v. It panics if v is not a JavaScript object.

func (Value) Equal added in v1.17.2

func (v Value) Equal(w Value) bool

func (Value) Float

func (v Value) Float() float64

func (Value) Get

func (v Value) Get(p string) Value

func (Value) Index

func (v Value) Index(i int) Value

func (Value) InstanceOf

func (v Value) InstanceOf(t Value) bool

func (Value) Int

func (v Value) Int() int

func (Value) Invoke

func (v Value) Invoke(args ...interface{}) Value

func (Value) IsNaN added in v1.17.2

func (v Value) IsNaN() bool

func (Value) IsNull added in v1.17.2

func (v Value) IsNull() bool

func (Value) IsUndefined added in v1.17.2

func (v Value) IsUndefined() bool

func (Value) JSValue

func (v Value) JSValue() Value

func (Value) Length

func (v Value) Length() int

func (Value) New

func (v Value) New(args ...interface{}) Value

func (Value) Set

func (v Value) Set(p string, x interface{})

func (Value) SetIndex

func (v Value) SetIndex(i int, x interface{})

func (Value) String

func (v Value) String() string

String returns the value v as a string. String is a special case because of Go's String method convention. Unlike the other getters, it does not panic if v's Type is not TypeString. Instead, it returns a string of the form "<T>" or "<T: V>" where T is v's type and V is a string representation of v's value.

func (Value) Truthy

func (v Value) Truthy() bool

func (Value) Type

func (v Value) Type() Type

type ValueError

type ValueError struct {
	Method string
	Type   Type

func (*ValueError) Error

func (e *ValueError) Error() string

type Wrapper

type Wrapper interface {
	JSValue() Value

Jump to

Keyboard shortcuts

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