Example #1
0
// See: http://duktape.org/api.html#duk_safe_call
func (d *Context) SafeCall(fn *[0]byte, nargs, nrets int) int {
	return int(C.duk_safe_call(
		d.duk_context,
		fn,
		C.duk_idx_t(nargs),
		C.duk_idx_t(nrets),
	))
}
Example #2
0
// See: http://duktape.org/api.html#duk_next
func (d *Context) Next(enumIndex int, getValue bool) bool {
	var __getValue__ int
	if getValue {
		__getValue__ = 1
	}
	return int(C.duk_next(d.duk_context, C.duk_idx_t(enumIndex), C.duk_bool_t(__getValue__))) == 1
}
Example #3
0
// See: http://duktape.org/api.html#duk_hex_decode
func (d *Context) HexDecode(index int) {
	C.duk_hex_decode(d.duk_context, C.duk_idx_t(index))
}
Example #4
0
// See: http://duktape.org/api.html#duk_pop_n
func (d *Context) PopN(count int) {
	if d.GetTop() < count || count < 1 {
		return
	}
	C.duk_pop_n(d.duk_context, C.duk_idx_t(count))
}
Example #5
0
// See: http://duktape.org/api.html#duk_pcall_method
func (d *Context) PcallMethod(nargs int) int {
	return int(C.duk_pcall_method(d.duk_context, C.duk_idx_t(nargs)))
}
Example #6
0
// See: http://duktape.org/api.html#duk_json_encode
func (d *Context) JsonEncode(index int) string {
	if s := C.duk_json_encode(d.duk_context, C.duk_idx_t(index)); s != nil {
		return C.GoString(s)
	}
	return ""
}
Example #7
0
// See: http://duktape.org/api.html#duk_join
func (d *Context) Join(count int) {
	C.duk_join(d.duk_context, C.duk_idx_t(count))
}
Example #8
0
// See: http://duktape.org/api.html#duk_is_undefined
func (d *Context) IsUndefined(index int) bool {
	return int(C.duk_is_undefined(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #9
0
// See: http://duktape.org/api.html#duk_is_fixed_buffer
func (d *Context) IsFixedBuffer(index int) bool {
	return int(C.duk_is_fixed_buffer(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #10
0
// See: http://duktape.org/api.html#duk_is_ecmascript_function
func (d *Context) IsEcmascriptFunction(index int) bool {
	return int(C.duk_is_ecmascript_function(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #11
0
// See: http://duktape.org/api.html#duk_is_dynamic_buffer
func (d *Context) IsDynamicBuffer(index int) bool {
	return int(C.duk_is_dynamic_buffer(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #12
0
// See: http://duktape.org/api.html#duk_is_callable
func (d *Context) IsCallable(index int) bool {
	return int(C.duk_is_callable(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #13
0
// See: http://duktape.org/api.html#duk_is_boolean
func (d *Context) IsBoolean(index int) bool {
	return int(C.duk_is_boolean(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #14
0
// See: http://duktape.org/api.html#duk_is_array
func (d *Context) IsArray(index int) bool {
	return int(C.duk_is_array(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #15
0
// See: http://duktape.org/api.html#duk_insert
func (d *Context) Insert(toIndex int) {
	C.duk_insert(d.duk_context, C.duk_idx_t(toIndex))
}
Example #16
0
// See: http://duktape.org/api.html#duk_is_string
func (d *Context) IsString(index int) bool {
	return int(C.duk_is_string(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #17
0
// See: http://duktape.org/api.html#duk_is_thread
func (d *Context) IsThread(index int) bool {
	return int(C.duk_is_thread(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #18
0
// See: http://duktape.org/api.html#duk_is_function
func (d *Context) IsFunction(index int) bool {
	return int(C.duk_is_function(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #19
0
// See: http://duktape.org/api.html#duk_is_valid_index
func (d *Context) IsValidIndex(index int) bool {
	return int(C.duk_is_valid_index(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #20
0
// See: http://duktape.org/api.html#duk_is_null
func (d *Context) IsNull(index int) bool {
	return int(C.duk_is_null(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #21
0
// See: http://duktape.org/api.html#duk_json_decode
func (d *Context) JsonDecode(index int) {
	C.duk_json_decode(d.duk_context, C.duk_idx_t(index))
}
Example #22
0
// See: http://duktape.org/api.html#duk_is_object
func (d *Context) IsObject(index int) bool {
	return int(C.duk_is_object(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #23
0
// See: http://duktape.org/api.html#duk_new
func (d *Context) New(nargs int) {
	C.duk_new(d.duk_context, C.duk_idx_t(nargs))
}
Example #24
0
// See: http://duktape.org/api.html#duk_is_error
func (d *Context) IsError(index int) bool {
	return int(C._duk_is_error(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #25
0
// See: http://duktape.org/api.html#duk_normalize_index
func (d *Context) NormalizeIndex(index int) int {
	return int(C.duk_normalize_index(d.duk_context, C.duk_idx_t(index)))
}
Example #26
0
// See: http://duktape.org/api.html#duk_is_object_coercible
func (d *Context) IsObjectCoercible(index int) bool {
	return int(C._duk_is_object_coercible(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #27
0
// See: http://duktape.org/api.html#duk_pcall_prop
func (d *Context) PcallProp(objIndex int, nargs int) int {
	return int(C.duk_pcall_prop(d.duk_context, C.duk_idx_t(objIndex), C.duk_idx_t(nargs)))
}
Example #28
0
// See: http://duktape.org/api.html#duk_is_pointer
func (d *Context) IsPointer(index int) bool {
	return int(C.duk_is_pointer(d.duk_context, C.duk_idx_t(index))) == 1
}
Example #29
0
// See: http://duktape.org/api.html#duk_push_c_function
func (d *Context) PushCFunction(fn *[0]byte, nargs int) int {
	return int(C.duk_push_c_function(d.duk_context, fn, C.duk_idx_t(nargs)))
}
Example #30
0
// See: http://duktape.org/api.html#duk_is_primitive
func (d *Context) IsPrimitive(index int) bool {
	return int(C.duk_is_primitive(d.duk_context, C.duk_idx_t(index))) == 1
}