Exemple #1
0
// See: http://duktape.org/api.html#duk_pcompile_string_filename
func (d *Context) PcompileStringFilename(flags uint, src string) error {
	__src__ := C.CString(src)
	defer C.free(unsafe.Pointer(__src__))

	result := int(C._duk_pcompile_string_filename(d.duk_context, C.duk_uint_t(flags), __src__))
	return d.castStringToError(result)
}
Exemple #2
0
// See: http://duktape.org/api.html#duk_pcompile_file
func (d *Context) PcompileFile(flags uint, path string) error {
	__path__ := C.CString(path)
	defer C.free(unsafe.Pointer(__path__))

	result := int(C._duk_pcompile_file(d.duk_context, C.duk_uint_t(flags), __path__))
	return d.castStringToError(result)
}
Exemple #3
0
// See: http://duktape.org/api.html#duk_pcompile_lstring
func (d *Context) PcompileLstring(flags uint, src string, len int) error {
	__src__ := C.CString(src)
	defer C.free(unsafe.Pointer(__src__))

	result := int(C._duk_pcompile_lstring(d.duk_context, C.duk_uint_t(flags), __src__, C.duk_size_t(len)))
	return d.castStringToError(result)
}
Exemple #4
0
// See: http://duktape.org/api.html#duk_gc
func (d *Context) Gc(flags uint) {
	C.duk_gc(d.duk_context, C.duk_uint_t(flags))
}
Exemple #5
0
// See: http://duktape.org/api.html#duk_pcompile
func (d *Context) Pcompile(flags uint) error {
	result := int(C._duk_pcompile(d.duk_context, C.duk_uint_t(flags)))
	return d.castStringToError(result)
}
Exemple #6
0
// See: http://duktape.org/api.html#duk_def_prop
func (d *Context) DefProp(objIndex int, flags uint) {
	C.duk_def_prop(d.duk_context, C.duk_idx_t(objIndex), C.duk_uint_t(flags))
}
Exemple #7
0
// See: http://duktape.org/api.html#duk_enum
func (d *Context) Enum(objIndex int, enumFlags uint) {
	C.duk_enum(d.duk_context, C.duk_idx_t(objIndex), C.duk_uint_t(enumFlags))
}
Exemple #8
0
// See: http://duktape.org/api.html#duk_compile_lstring_filename
func (d *Context) CompileLstringFilename(flags uint, src string, len int) {
	__src__ := C.CString(src)
	defer C.free(unsafe.Pointer(__src__))
	C._duk_compile_lstring_filename(d.duk_context, C.duk_uint_t(flags), __src__, C.duk_size_t(len))
}
Exemple #9
0
// See: http://duktape.org/api.html#duk_compile_string_filename
func (d *Context) CompileStringFilename(flags uint, src string) {
	__src__ := C.CString(src)
	defer C.free(unsafe.Pointer(__src__))
	C._duk_compile_string_filename(d.duk_context, C.duk_uint_t(flags), __src__)
}
Exemple #10
0
// See: http://duktape.org/api.html#duk_compile_file
func (d *Context) CompileFile(flags uint, path string) {
	__path__ := C.CString(path)
	defer C.free(unsafe.Pointer(__path__))
	C._duk_compile_file(d.duk_context, C.duk_uint_t(flags), __path__)
}
Exemple #11
0
// See: http://duktape.org/api.html#duk_compile
func (d *Context) Compile(flags uint) {
	C._duk_compile(d.duk_context, C.duk_uint_t(flags))
}
Exemple #12
0
// See: http://duktape.org/api.html#duk_check_type_mask
func (d *Context) CheckTypeMask(index int, mask uint) bool {
	return int(C.duk_check_type_mask(d.duk_context, C.duk_idx_t(index), C.duk_uint_t(mask))) == 1
}
Exemple #13
0
// See: http://duktape.org/api.html#duk_require_type_mask
func (d *Context) RequireTypeMask(index int, mask uint) {
	C._duk_require_type_mask(d.duk_context, C.duk_idx_t(index), C.duk_uint_t(mask))
}
Exemple #14
0
// See: http://duktape.org/api.html#duk_push_uint
func (d *Context) PushUint(val uint) {
	C.duk_push_uint(d.duk_context, C.duk_uint_t(val))
}