Help us shape the future of Go! Take the 2026 Go Developer Survey

duktape

package module
v0.0.0-...-b415023 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: MIT Imports: 5 Imported by: 3

README

Duktape bindings for Go(Golang) wercker status

Duktape is a thin, embeddable javascript engine. Most of the api is implemented. The exceptions are listed here.

Usage
package main

import "fmt"
import "github.com/olebedev/go-duktape"

func main() {
  ctx := duktape.NewContext()
  ctx.EvalString(`2 + 3`)
  result := ctx.GetNumber(-1)
  ctx.Pop()
  fmt.Println("result is:", result)
}
Go specific notes

Bindings between Go and Javascript contexts are not fully functional. However, binding a Go function to the Javascript context is available:

package main

import "fmt"
import "github.com/olebedev/go-duktape"

func main() {
  ctx := duktape.NewContext()
  ctx.PushGofunc("log", func(ctx *duktape.Context) int {
    fmt.Println("Go lang Go!")
    return 0
  })
  ctx.EvalString(`log()`)
}

than run it.

$ go run
$ Go lang Go!
Status

The package is not fully tested, so be careful.

Contribution

Pull requests are welcome!
Convention: fork the repository and make changes on your fork in a feature branch.

Documentation

Index

Constants

View Source
const (
	DUK_ENUM_INCLUDE_NONENUMERABLE = C.DUK_ENUM_INCLUDE_NONENUMERABLE
	DUK_ENUM_INCLUDE_INTERNAL      = C.DUK_ENUM_INCLUDE_INTERNAL
	DUK_ENUM_OWN_PROPERTIES_ONLY   = C.DUK_ENUM_OWN_PROPERTIES_ONLY
	DUK_ENUM_ARRAY_INDICES_ONLY    = C.DUK_ENUM_ARRAY_INDICES_ONLY
	DUK_ENUM_SORT_ARRAY_INDICES    = C.DUK_ENUM_SORT_ARRAY_INDICES
	DUK_ENUM_NO_PROXY_BEHAVIOR     = C.DUK_ENUM_NO_PROXY_BEHAVIOR
)
View Source
const (
	DUK_RET_UNIMPLEMENTED_ERROR = C.DUK_RET_UNIMPLEMENTED_ERROR
	DUK_RET_UNSUPPORTED_ERROR   = C.DUK_RET_UNSUPPORTED_ERROR
	DUK_RET_INTERNAL_ERROR      = C.DUK_RET_INTERNAL_ERROR
	DUK_RET_ALLOC_ERROR         = C.DUK_RET_ALLOC_ERROR
	DUK_RET_ASSERTION_ERROR     = C.DUK_RET_ASSERTION_ERROR
	DUK_RET_API_ERROR           = C.DUK_RET_API_ERROR
	DUK_RET_UNCAUGHT_ERROR      = C.DUK_RET_UNCAUGHT_ERROR
	DUK_RET_ERROR               = C.DUK_RET_ERROR
	DUK_RET_EVAL_ERROR          = C.DUK_RET_EVAL_ERROR
	DUK_RET_RANGE_ERROR         = C.DUK_RET_RANGE_ERROR
	DUK_RET_REFERENCE_ERROR     = C.DUK_RET_REFERENCE_ERROR
	DUK_RET_SYNTAX_ERROR        = C.DUK_RET_SYNTAX_ERROR
	DUK_RET_TYPE_ERROR          = C.DUK_RET_TYPE_ERROR
	DUK_RET_URI_ERROR           = C.DUK_RET_URI_ERROR
	DUK_RET_INSTACK_ERROR       = C.DUK_RET_INSTACK_ERROR
)
View Source
const (
	DUK_COMPILE_EVAL     = C.DUK_COMPILE_EVAL
	DUK_COMPILE_FUNCTION = C.DUK_COMPILE_FUNCTION
	DUK_COMPILE_STRICT   = C.DUK_COMPILE_STRICT
)
View Source
const (
	DUK_ERR_UNIMPLEMENTED_ERROR = C.DUK_ERR_UNIMPLEMENTED_ERROR
	DUK_ERR_UNSUPPORTED_ERROR   = C.DUK_ERR_UNSUPPORTED_ERROR
	DUK_ERR_INTERNAL_ERROR      = C.DUK_ERR_INTERNAL_ERROR
	DUK_ERR_ALLOC_ERROR         = C.DUK_ERR_ALLOC_ERROR
	DUK_ERR_ASSERTION_ERROR     = C.DUK_ERR_ASSERTION_ERROR
	DUK_ERR_API_ERROR           = C.DUK_ERR_API_ERROR
	DUK_ERR_UNCAUGHT_ERROR      = C.DUK_ERR_UNCAUGHT_ERROR
	DUK_ERR_ERROR               = C.DUK_ERR_ERROR
	DUK_ERR_EVAL_ERROR          = C.DUK_ERR_EVAL_ERROR
	DUK_ERR_RANGE_ERROR         = C.DUK_ERR_RANGE_ERROR
	DUK_ERR_REFERENCE_ERROR     = C.DUK_ERR_REFERENCE_ERROR
	DUK_ERR_SYNTAX_ERROR        = C.DUK_ERR_SYNTAX_ERROR
	DUK_ERR_TYPE_ERROR          = C.DUK_ERR_TYPE_ERROR
	DUK_ERR_URI_ERROR           = C.DUK_ERR_URI_ERROR
	DUK_ERR_INSTACK_ERROR       = C.DUK_ERR_INSTACK_ERROR
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

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

func NewContext

func NewContext() *Context

Returns initialized duktape context object

func (*Context) Alloc

func (d *Context) Alloc(size int)

See: http://duktape.org/api.html#duk_alloc

func (*Context) AllocRaw

func (d *Context) AllocRaw(size int)

See: http://duktape.org/api.html#duk_alloc_raw

func (*Context) Base64Decode

func (d *Context) Base64Decode(index int)

See: http://duktape.org/api.html#duk_base64_decode

func (*Context) Base64Encode

func (d *Context) Base64Encode(index int) string

See: http://duktape.org/api.html#duk_base64_encode

func (*Context) Call

func (d *Context) Call(nargs int)

See: http://duktape.org/api.html#duk_call

func (*Context) CallMethod

func (d *Context) CallMethod(nargs int)

See: http://duktape.org/api.html#duk_call_method

func (*Context) CallProp

func (d *Context) CallProp(objIndex int, nargs int)

See: http://duktape.org/api.html#duk_call_prop

func (*Context) CheckStack

func (d *Context) CheckStack(extra int) bool

See: http://duktape.org/api.html#duk_check_stack

func (*Context) CheckStackTop

func (d *Context) CheckStackTop(top int) bool

See: http://duktape.org/api.html#duk_check_stack_top

func (*Context) CheckType

func (d *Context) CheckType(index int, typ int) bool

See: http://duktape.org/api.html#duk_check_type

func (*Context) CheckTypeMask

func (d *Context) CheckTypeMask(index int, mask uint) bool

See: http://duktape.org/api.html#duk_check_type_mask

func (*Context) Compact

func (d *Context) Compact(objIndex int)

See: http://duktape.org/api.html#duk_compact

func (*Context) Compile

func (d *Context) Compile(flags uint)

See: http://duktape.org/api.html#duk_compile

func (*Context) CompileFile

func (d *Context) CompileFile(flags uint, path string)

See: http://duktape.org/api.html#duk_compile_file

func (*Context) CompileLstring

func (d *Context) CompileLstring(flags uint, src string, len int)

See: http://duktape.org/api.html#duk_compile_lstring

func (*Context) CompileLstringFilename

func (d *Context) CompileLstringFilename(flags uint, src string, len int)

See: http://duktape.org/api.html#duk_compile_lstring_filename

func (*Context) CompileString

func (d *Context) CompileString(flags uint, src string)

See: http://duktape.org/api.html#duk_compile_string

func (*Context) CompileStringFilename

func (d *Context) CompileStringFilename(flags uint, src string)

See: http://duktape.org/api.html#duk_compile_string_filename

func (*Context) Concat

func (d *Context) Concat(count int)

See: http://duktape.org/api.html#duk_concat

func (*Context) Copy

func (d *Context) Copy(fromIndex int, toIndex int)

See: http://duktape.org/api.html#duk_copy

func (*Context) DelProp

func (d *Context) DelProp(objIndex int) bool

See: http://duktape.org/api.html#duk_del_prop

func (*Context) DelPropIndex

func (d *Context) DelPropIndex(objIndex int, arrIndex uint) bool

See: http://duktape.org/api.html#duk_del_prop_index

func (*Context) DelPropString

func (d *Context) DelPropString(objIndex int, key string) bool

See: http://duktape.org/api.html#duk_del_prop_string

func (*Context) DestroyHeap

func (d *Context) DestroyHeap()

See: http://duktape.org/api.html#duk_destroy_heap

func (*Context) DumpContextStderr

func (d *Context) DumpContextStderr()

See: http://duktape.org/api.html#duk_dump_context_stderr

func (*Context) DumpContextStdout

func (d *Context) DumpContextStdout()

See: http://duktape.org/api.html#duk_dump_context_stdout

func (*Context) Dup

func (d *Context) Dup(fromIndex int)

See: http://duktape.org/api.html#duk_dup

func (*Context) DupTop

func (d *Context) DupTop()

See: http://duktape.org/api.html#duk_dup_top

func (*Context) Enum

func (d *Context) Enum(objIndex int, enumFlags uint)

See: http://duktape.org/api.html#duk_enum

func (*Context) Equals

func (d *Context) Equals(index1 int, index2 int) bool

See: http://duktape.org/api.html#duk_equals

func (*Context) Eval

func (d *Context) Eval()

See: http://duktape.org/api.html#duk_eval

func (*Context) EvalFile

func (d *Context) EvalFile(path string)

See: http://duktape.org/api.html#duk_eval_file

func (*Context) EvalFileNoresult

func (d *Context) EvalFileNoresult(path string)

See: http://duktape.org/api.html#duk_eval_file_noresult

func (*Context) EvalLstring

func (d *Context) EvalLstring(src string, len int)

See: http://duktape.org/api.html#duk_eval_lstring

func (*Context) EvalLstringNoresult

func (d *Context) EvalLstringNoresult(src string, len int)

See: http://duktape.org/api.html#duk_eval_lstring_noresult

func (*Context) EvalNoresult

func (d *Context) EvalNoresult()

See: http://duktape.org/api.html#duk_eval_noresult

func (*Context) EvalString

func (d *Context) EvalString(src string)

See: http://duktape.org/api.html#duk_eval_string

func (*Context) EvalStringNoresult

func (d *Context) EvalStringNoresult(src string)

See: http://duktape.org/api.html#duk_eval_string_noresult

func (*Context) EvalWith

func (d *Context) EvalWith(source string, suite MethodSuite) error

func (*Context) Fatal

func (d *Context) Fatal(errCode int, errMsg string)

See: http://duktape.org/api.html#duk_fatal

func (*Context) Gc

func (d *Context) Gc(flags uint)

See: http://duktape.org/api.html#duk_gc

func (*Context) GetBoolean

func (d *Context) GetBoolean(index int) bool

See: http://duktape.org/api.html#duk_get_boolean

func (*Context) GetBuffer

func (d *Context) GetBuffer(index int, outSize int)

See: http://duktape.org/api.html#duk_get_buffer

func (*Context) GetContext

func (d *Context) GetContext(index int) *Context

See: http://duktape.org/api.html#duk_get_context

func (*Context) GetCurrentMagic

func (d *Context) GetCurrentMagic() int

See: http://duktape.org/api.html#duk_get_current_magic

func (*Context) GetFinalizer

func (d *Context) GetFinalizer(index int)

See: http://duktape.org/api.html#duk_get_finalizer

func (*Context) GetGlobalString

func (d *Context) GetGlobalString(key string) bool

See: http://duktape.org/api.html#duk_get_global_string

func (*Context) GetGoObject

func (d *Context) GetGoObject(objIndex int) interface{}

func (*Context) GetInt

func (d *Context) GetInt(index int) int

See: http://duktape.org/api.html#duk_get_int

func (*Context) GetInternalPropString

func (d *Context) GetInternalPropString(objIndex int, key string) bool

func (*Context) GetLength

func (d *Context) GetLength(index int) int

See: http://duktape.org/api.html#duk_get_length

func (*Context) GetLstring

func (d *Context) GetLstring(index int, outLen int) string

See: http://duktape.org/api.html#duk_get_lstring

func (*Context) GetMagic

func (d *Context) GetMagic(index int) int

See: http://duktape.org/api.html#duk_get_magic

func (*Context) GetNumber

func (d *Context) GetNumber(index int) float64

See: http://duktape.org/api.html#duk_get_number

func (*Context) GetPointer

func (d *Context) GetPointer(index int) unsafe.Pointer

See: http://duktape.org/api.html#duk_get_pointer

func (*Context) GetProp

func (d *Context) GetProp(objIndex int) bool

See: http://duktape.org/api.html#duk_get_prop

func (*Context) GetPropIndex

func (d *Context) GetPropIndex(objIndex int, arrIndex uint) bool

See: http://duktape.org/api.html#duk_get_prop_index

func (*Context) GetPropString

func (d *Context) GetPropString(objIndex int, key string) bool

See: http://duktape.org/api.html#duk_get_prop_string

func (*Context) GetPrototype

func (d *Context) GetPrototype(index int)

See: http://duktape.org/api.html#duk_get_prototype

func (*Context) GetString

func (d *Context) GetString(i int) string

See: http://duktape.org/api.html#duk_get_string

func (*Context) GetTop

func (d *Context) GetTop() int

See: http://duktape.org/api.html#duk_get_top

func (*Context) GetTopIndex

func (d *Context) GetTopIndex() int

See: http://duktape.org/api.html#duk_get_top_index

func (*Context) GetType

func (d *Context) GetType(index int) int

See: http://duktape.org/api.html#duk_get_type

func (*Context) GetTypeMask

func (d *Context) GetTypeMask(index int) uint

See: http://duktape.org/api.html#duk_get_type_mask

func (*Context) GetUint

func (d *Context) GetUint(index int) uint

See: http://duktape.org/api.html#duk_get_uint

func (*Context) HasProp

func (d *Context) HasProp(objIndex int) bool

See: http://duktape.org/api.html#duk_has_prop

func (*Context) HasPropIndex

func (d *Context) HasPropIndex(objIndex int, arrIndex uint) bool

See: http://duktape.org/api.html#duk_has_prop_index

func (*Context) HasPropString

func (d *Context) HasPropString(objIndex int, key string) bool

See: http://duktape.org/api.html#duk_has_prop_string

func (*Context) HexDecode

func (d *Context) HexDecode(index int)

See: http://duktape.org/api.html#duk_hex_decode

func (*Context) HexEncode

func (d *Context) HexEncode(index int) string

See: http://duktape.org/api.html#duk_hex_encode

func (*Context) Insert

func (d *Context) Insert(toIndex int)

See: http://duktape.org/api.html#duk_insert

func (*Context) IsArray

func (d *Context) IsArray(index int) bool

See: http://duktape.org/api.html#duk_is_array

func (*Context) IsBoolean

func (d *Context) IsBoolean(index int) bool

See: http://duktape.org/api.html#duk_is_boolean

func (*Context) IsBoundFunction

func (d *Context) IsBoundFunction(index int) bool

See: http://duktape.org/api.html#duk_is_bound_function

func (*Context) IsBuffer

func (d *Context) IsBuffer(index int) bool

See: http://duktape.org/api.html#duk_is_buffer

func (*Context) IsCFunction

func (d *Context) IsCFunction(index int) bool

See: http://duktape.org/api.html#duk_is_c_function

func (*Context) IsCallable

func (d *Context) IsCallable(index int) bool

See: http://duktape.org/api.html#duk_is_callable

func (*Context) IsConstructorCall

func (d *Context) IsConstructorCall() bool

See: http://duktape.org/api.html#duk_is_constructor_call

func (*Context) IsDynamicBuffer

func (d *Context) IsDynamicBuffer(index int) bool

See: http://duktape.org/api.html#duk_is_dynamic_buffer

func (*Context) IsEcmascriptFunction

func (d *Context) IsEcmascriptFunction(index int) bool

See: http://duktape.org/api.html#duk_is_ecmascript_function

func (*Context) IsFixedBuffer

func (d *Context) IsFixedBuffer(index int) bool

See: http://duktape.org/api.html#duk_is_fixed_buffer

func (*Context) IsFunction

func (d *Context) IsFunction(index int) bool

See: http://duktape.org/api.html#duk_is_function

func (*Context) IsNan

func (d *Context) IsNan(index int) bool

See: http://duktape.org/api.html#duk_is_nan

func (*Context) IsNull

func (d *Context) IsNull(index int) bool

See: http://duktape.org/api.html#duk_is_null

func (*Context) IsNullOrUndefined

func (d *Context) IsNullOrUndefined(index int) bool

See: http://duktape.org/api.html#duk_is_null_or_undefined

func (*Context) IsNumber

func (d *Context) IsNumber(index int) bool

See: http://duktape.org/api.html#duk_is_number

func (*Context) IsObject

func (d *Context) IsObject(index int) bool

See: http://duktape.org/api.html#duk_is_object

func (*Context) IsObjectCoercible

func (d *Context) IsObjectCoercible(index int) bool

See: http://duktape.org/api.html#duk_is_object_coercible

func (*Context) IsPointer

func (d *Context) IsPointer(index int) bool

See: http://duktape.org/api.html#duk_is_pointer

func (*Context) IsPrimitive

func (d *Context) IsPrimitive(index int) bool

See: http://duktape.org/api.html#duk_is_primitive

func (*Context) IsStrictCall

func (d *Context) IsStrictCall() bool

See: http://duktape.org/api.html#duk_is_strict_call

func (*Context) IsString

func (d *Context) IsString(index int) bool

See: http://duktape.org/api.html#duk_is_string

func (*Context) IsThread

func (d *Context) IsThread(index int) bool

See: http://duktape.org/api.html#duk_is_thread

func (*Context) IsUndefined

func (d *Context) IsUndefined(index int) bool

See: http://duktape.org/api.html#duk_is_undefined

func (*Context) IsValidIndex

func (d *Context) IsValidIndex(index int) bool

See: http://duktape.org/api.html#duk_is_valid_index

func (*Context) Join

func (d *Context) Join(count int)

See: http://duktape.org/api.html#duk_join

func (*Context) JsonDecode

func (d *Context) JsonDecode(index int)

See: http://duktape.org/api.html#duk_json_decode

func (*Context) JsonEncode

func (d *Context) JsonEncode(index int) string

See: http://duktape.org/api.html#duk_json_encode

func (*Context) New

func (d *Context) New(nargs int)

See: http://duktape.org/api.html#duk_new

func (*Context) Next

func (d *Context) Next(enumIndex int, getValue bool) bool

See: http://duktape.org/api.html#duk_next

func (*Context) NormalizeIndex

func (d *Context) NormalizeIndex(index int) int

See: http://duktape.org/api.html#duk_normalize_index

func (*Context) Pcall

func (d *Context) Pcall(nargs int) int

See: http://duktape.org/api.html#duk_pcall

func (*Context) PcallMethod

func (d *Context) PcallMethod(nargs int) int

See: http://duktape.org/api.html#duk_pcall_method

func (*Context) PcallProp

func (d *Context) PcallProp(objIndex int, nargs int) int

See: http://duktape.org/api.html#duk_pcall_prop

func (*Context) Pcompile

func (d *Context) Pcompile(flags uint) int

See: http://duktape.org/api.html#duk_pcompile

func (*Context) PcompileFile

func (d *Context) PcompileFile(flags uint, path string) int

See: http://duktape.org/api.html#duk_pcompile_file

func (*Context) PcompileLstring

func (d *Context) PcompileLstring(flags uint, src string, len int) int

See: http://duktape.org/api.html#duk_pcompile_lstring

func (*Context) PcompileLstringFilename

func (d *Context) PcompileLstringFilename(flags uint, src string, len int) int

See: http://duktape.org/api.html#duk_pcompile_lstring_filename

func (*Context) PcompileString

func (d *Context) PcompileString(flags uint, src string) int

See: http://duktape.org/api.html#duk_pcompile_string

func (*Context) PcompileStringFilename

func (d *Context) PcompileStringFilename(flags uint, src string) int

See: http://duktape.org/api.html#duk_pcompile_string_filename

func (*Context) Peval

func (d *Context) Peval() int

See: http://duktape.org/api.html#duk_peval

func (*Context) PevalFile

func (d *Context) PevalFile(path string) int

See: http://duktape.org/api.html#duk_peval_file

func (*Context) PevalFileNoresult

func (d *Context) PevalFileNoresult(path string) int

See: http://duktape.org/api.html#duk_peval_file_noresult

func (*Context) PevalLstring

func (d *Context) PevalLstring(src string, len int) int

See: http://duktape.org/api.html#duk_peval_lstring

func (*Context) PevalLstringNoresult

func (d *Context) PevalLstringNoresult(src string, len int) int

See: http://duktape.org/api.html#duk_peval_lstring_noresult

func (*Context) PevalNoresult

func (d *Context) PevalNoresult() int

See: http://duktape.org/api.html#duk_peval_noresult

func (*Context) PevalString

func (d *Context) PevalString(src string) int

See: http://duktape.org/api.html#duk_peval_string

func (*Context) PevalStringNoresult

func (d *Context) PevalStringNoresult(src string) int

See: http://duktape.org/api.html#duk_peval_string_noresult

func (*Context) Pop

func (d *Context) Pop()

See: http://duktape.org/api.html#duk_pop

func (*Context) Pop2

func (d *Context) Pop2()

See: http://duktape.org/api.html#duk_pop_2

func (*Context) Pop3

func (d *Context) Pop3()

See: http://duktape.org/api.html#duk_pop_3

func (*Context) PopN

func (d *Context) PopN(count int)

See: http://duktape.org/api.html#duk_pop_n

func (*Context) PushArray

func (d *Context) PushArray() int

See: http://duktape.org/api.html#duk_push_array

func (*Context) PushBoolean

func (d *Context) PushBoolean(val bool)

See: http://duktape.org/api.html#duk_push_boolean

func (*Context) PushBuffer

func (d *Context) PushBuffer(size int, dynamic bool)

See: http://duktape.org/api.html#duk_push_buffer

func (*Context) PushCFunction

func (d *Context) PushCFunction(fn *[0]byte, nargs int) int

See: http://duktape.org/api.html#duk_push_c_function

func (*Context) PushContextDump

func (d *Context) PushContextDump()

See: http://duktape.org/api.html#duk_push_context_dump

func (*Context) PushCurrentFunction

func (d *Context) PushCurrentFunction()

See: http://duktape.org/api.html#duk_push_current_function

func (*Context) PushCurrentThread

func (d *Context) PushCurrentThread()

See: http://duktape.org/api.html#duk_push_current_thread

func (*Context) PushDynamicBuffer

func (d *Context) PushDynamicBuffer(size int)

See: http://duktape.org/api.html#duk_push_dynamic_buffer

func (*Context) PushErrorObject

func (d *Context) PushErrorObject(errCode int, errMsg string) int

See: http://duktape.org/api.html#duk_push_error_object

func (*Context) PushFalse

func (d *Context) PushFalse()

See: http://duktape.org/api.html#duk_push_false

func (*Context) PushFixedBuffer

func (d *Context) PushFixedBuffer(size int)

See: http://duktape.org/api.html#duk_push_fixed_buffer

func (*Context) PushGlobalObject

func (d *Context) PushGlobalObject()

See: http://duktape.org/api.html#duk_push_global_object

func (*Context) PushGlobalStash

func (d *Context) PushGlobalStash()

See: http://duktape.org/api.html#duk_push_global_stash

func (*Context) PushGoFunc

func (d *Context) PushGoFunc(f GoFunc)

Push goCall with its "goFuncData" property set to fd

func (*Context) PushGoObject

func (d *Context) PushGoObject(o interface{})

func (*Context) PushHeapStash

func (d *Context) PushHeapStash()

See: http://duktape.org/api.html#duk_push_heap_stash

func (*Context) PushInt

func (d *Context) PushInt(val int)

See: http://duktape.org/api.html#duk_push_int

func (*Context) PushLstring

func (d *Context) PushLstring(str string, len int) string

See: http://duktape.org/api.html#duk_push_lstring

func (*Context) PushNan

func (d *Context) PushNan()

See: http://duktape.org/api.html#duk_push_nan

func (*Context) PushNull

func (d *Context) PushNull()

See: http://duktape.org/api.html#duk_push_null

func (*Context) PushNumber

func (d *Context) PushNumber(val float64)

See: http://duktape.org/api.html#duk_push_number

func (*Context) PushObject

func (d *Context) PushObject() int

See: http://duktape.org/api.html#duk_push_object

func (*Context) PushPointer

func (d *Context) PushPointer(p unsafe.Pointer)

See: http://duktape.org/api.html#duk_push_pointer

func (*Context) PushString

func (d *Context) PushString(str string) string

See: http://duktape.org/api.html#duk_push_string

func (*Context) PushStringFile

func (d *Context) PushStringFile(path string) string

TODO: return string See: http://duktape.org/api.html#duk_push_string_file

func (*Context) PushThis

func (d *Context) PushThis()

See: http://duktape.org/api.html#duk_push_this

func (*Context) PushThread

func (d *Context) PushThread() int

See: http://duktape.org/api.html#duk_push_thread

func (*Context) PushThreadNewGlobalenv

func (d *Context) PushThreadNewGlobalenv() int

See: http://duktape.org/api.html#duk_push_thread_new_globalenv

func (*Context) PushThreadStash

func (d *Context) PushThreadStash(targetCtx *Context)

See: http://duktape.org/api.html#duk_push_thread_stash

func (*Context) PushTrue

func (d *Context) PushTrue()

See: http://duktape.org/api.html#duk_push_true

func (*Context) PushUint

func (d *Context) PushUint(val uint)

See: http://duktape.org/api.html#duk_push_uint

func (*Context) PushUndefined

func (d *Context) PushUndefined()

See: http://duktape.org/api.html#duk_push_undefined

func (*Context) PutGlobalString

func (d *Context) PutGlobalString(key string) bool

See: http://duktape.org/api.html#duk_put_global_string

func (*Context) PutInternalPropString

func (d *Context) PutInternalPropString(objIndex int, key string) bool

func (*Context) PutProp

func (d *Context) PutProp(objIndex int) bool

See: http://duktape.org/api.html#duk_put_prop

func (*Context) PutPropIndex

func (d *Context) PutPropIndex(objIndex int, arrIndex uint) bool

See: http://duktape.org/api.html#duk_put_prop_index

func (*Context) PutPropString

func (d *Context) PutPropString(objIndex int, key string) bool

See: http://duktape.org/api.html#duk_put_prop_string

func (*Context) Remove

func (d *Context) Remove(index int)

See: http://duktape.org/api.html#duk_remove

func (*Context) Replace

func (d *Context) Replace(toIndex int)

See: http://duktape.org/api.html#duk_replace

func (*Context) RequireBoolean

func (d *Context) RequireBoolean(index int) bool

See: http://duktape.org/api.html#duk_require_boolean

func (*Context) RequireBuffer

func (d *Context) RequireBuffer(index int, outSize int)

See: http://duktape.org/api.html#duk_require_buffer

func (*Context) RequireContext

func (d *Context) RequireContext(index int) *Context

See: http://duktape.org/api.html#duk_require_context

func (*Context) RequireInt

func (d *Context) RequireInt(index int) int

See: http://duktape.org/api.html#duk_require_int

func (*Context) RequireLstring

func (d *Context) RequireLstring(index int, outLen int) string

See: http://duktape.org/api.html#duk_require_lstring

func (*Context) RequireNormalizeIndex

func (d *Context) RequireNormalizeIndex(index int) int

See: http://duktape.org/api.html#duk_require_normalize_index

func (*Context) RequireNull

func (d *Context) RequireNull(index int)

See: http://duktape.org/api.html#duk_require_null

func (*Context) RequireNumber

func (d *Context) RequireNumber(index int) float64

See: http://duktape.org/api.html#duk_require_number

func (*Context) RequireObjectCoercible

func (d *Context) RequireObjectCoercible(index int)

See: http://duktape.org/api.html#duk_require_object_coercible

func (*Context) RequirePointer

func (d *Context) RequirePointer(index int)

See: http://duktape.org/api.html#duk_require_pointer

func (*Context) RequireStack

func (d *Context) RequireStack(extra int)

See: http://duktape.org/api.html#duk_require_stack

func (*Context) RequireStackTop

func (d *Context) RequireStackTop(top int)

See: http://duktape.org/api.html#duk_require_stack_top

func (*Context) RequireString

func (d *Context) RequireString(index int) string

See: http://duktape.org/api.html#duk_require_string

func (*Context) RequireTopIndex

func (d *Context) RequireTopIndex() int

See: http://duktape.org/api.html#duk_require_top_index

func (*Context) RequireTypeMask

func (d *Context) RequireTypeMask(index int, mask uint)

See: http://duktape.org/api.html#duk_require_type_mask

func (*Context) RequireUint

func (d *Context) RequireUint(index int) uint

See: http://duktape.org/api.html#duk_require_uint

func (*Context) RequireUndefined

func (d *Context) RequireUndefined(index int)

See: http://duktape.org/api.html#duk_require_undefined

func (*Context) RequireValidIndex

func (d *Context) RequireValidIndex(index int)

See: http://duktape.org/api.html#duk_require_valid_index

func (*Context) ResizeBuffer

func (d *Context) ResizeBuffer(index int, newSize int)

See: http://duktape.org/api.html#duk_resize_buffer

func (*Context) SafeCall

func (d *Context) SafeCall(fn *[0]byte, nargs, nrets int) int

See: http://duktape.org/api.html#duk_safe_call

func (*Context) SafeToLstring

func (d *Context) SafeToLstring(index int, outLen int) string

See: http://duktape.org/api.html#duk_safe_to_lstring

func (*Context) SafeToString

func (d *Context) SafeToString(index int) string

TODO:return string See: http://duktape.org/api.html#duk_safe_to_string

func (*Context) SetFinalizer

func (d *Context) SetFinalizer(index int)

See: http://duktape.org/api.html#duk_set_finalizer

func (*Context) SetGlobalObject

func (d *Context) SetGlobalObject()

See: http://duktape.org/api.html#duk_set_global_object

func (*Context) SetMagic

func (d *Context) SetMagic(index int, magic int)

See: http://duktape.org/api.html#duk_set_magic

func (*Context) SetPrototype

func (d *Context) SetPrototype(index int)

See: http://duktape.org/api.html#duk_set_prototype

func (*Context) SetTop

func (d *Context) SetTop(index int)

See: http://duktape.org/api.html#duk_set_top

func (*Context) StrictEquals

func (d *Context) StrictEquals(index1 int, index2 int) bool

TODO: return bool

func (*Context) Substring

func (d *Context) Substring(index int, startCharOffset int, endCharOffset int)

See: http://duktape.org/api.html#duk_substring

func (*Context) Swap

func (d *Context) Swap(index1 int, index2 int)

See: http://duktape.org/api.html#duk_swap

func (*Context) SwapTop

func (d *Context) SwapTop(index int)

See: http://duktape.org/api.html#duk_swap_top

func (*Context) Throw

func (d *Context) Throw()

See: http://duktape.org/api.html#duk_throw

func (*Context) ToBoolean

func (d *Context) ToBoolean(index int) bool

See: http://duktape.org/api.html#duk_to_boolean

func (*Context) ToBuffer

func (d *Context) ToBuffer(index int, outSize int)

See: http://duktape.org/api.html#duk_to_buffer

func (*Context) ToDefaultvalue

func (d *Context) ToDefaultvalue(index int, hint int)

See: http://duktape.org/api.html#duk_to_defaultvalue

func (*Context) ToDynamicBuffer

func (d *Context) ToDynamicBuffer(index int, outSize int)

See: http://duktape.org/api.html#duk_to_dynamic_buffer

func (*Context) ToFixedBuffer

func (d *Context) ToFixedBuffer(index int, outSize int)

See: http://duktape.org/api.html#duk_to_fixed_buffer

func (*Context) ToInt

func (d *Context) ToInt(index int) int

See: http://duktape.org/api.html#duk_to_int

func (*Context) ToInt32

func (d *Context) ToInt32(index int) int32

See: http://duktape.org/api.html#duk_to_int32

func (*Context) ToLstring

func (d *Context) ToLstring(index int, outLen int) string

See: http://duktape.org/api.html#duk_to_lstring

func (*Context) ToNull

func (d *Context) ToNull(index int)

See: http://duktape.org/api.html#duk_to_null

func (*Context) ToNumber

func (d *Context) ToNumber(index int) float64

See: http://duktape.org/api.html#duk_to_number

func (*Context) ToObject

func (d *Context) ToObject(index int)

See: http://duktape.org/api.html#duk_to_object

func (*Context) ToPointer

func (d *Context) ToPointer(index int)

See: http://duktape.org/api.html#duk_to_pointer

func (*Context) ToPrimitive

func (d *Context) ToPrimitive(index int, hint int)

See: http://duktape.org/api.html#duk_to_primitive

func (*Context) ToString

func (d *Context) ToString(index int) string

See: http://duktape.org/api.html#duk_to_string

func (*Context) ToUint

func (d *Context) ToUint(index int) uint

See: http://duktape.org/api.html#duk_to_uint

func (*Context) ToUint16

func (d *Context) ToUint16(index int) uint16

See: http://duktape.org/api.html#duk_to_uint16

func (*Context) ToUint32

func (d *Context) ToUint32(index int) uint32

See: http://duktape.org/api.html#duk_to_uint32

func (*Context) ToUndefined

func (d *Context) ToUndefined(index int)

See: http://duktape.org/api.html#duk_to_undefined

func (*Context) Trim

func (d *Context) Trim(index int)

See: http://duktape.org/api.html#duk_trim

func (*Context) XcopyTop

func (d *Context) XcopyTop(fromCtx *Context, count int)

See: http://duktape.org/api.html#duk_xcopy_top

func (*Context) XmoveTop

func (d *Context) XmoveTop(fromCtx *Context, count int)

See: http://duktape.org/api.html#duk_xmove_top

type GoFunc

type GoFunc func(d *Context) int

type GoFuncData

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

type MethodSuite

type MethodSuite map[string]GoFunc

type Type

type Type int
const (
	DUK_TYPE_NONE Type = iota
	DUK_TYPE_UNDEFINED
	DUK_TYPE_NULL
	DUK_TYPE_BOOLEAN
	DUK_TYPE_NUMBER
	DUK_TYPE_STRING
	DUK_TYPE_OBJECT
	DUK_TYPE_BUFFER
	DUK_TYPE_POINTER
)

func (Type) IsBool

func (t Type) IsBool() bool

func (Type) IsBuffer

func (t Type) IsBuffer() bool

func (Type) IsNone

func (t Type) IsNone() bool

func (Type) IsNull

func (t Type) IsNull() bool

func (Type) IsNumber

func (t Type) IsNumber() bool

func (Type) IsObject

func (t Type) IsObject() bool

func (Type) IsPointer

func (t Type) IsPointer() bool

func (Type) IsString

func (t Type) IsString() bool

func (Type) IsUndefined

func (t Type) IsUndefined() bool

Jump to

Keyboard shortcuts

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