func (value *basicValue) check(f unsafe.Pointer) bool { // put the reference on stack C.js_getregistry(value.state.vm, value.ref) defer C.js_pop(value.state.vm, 1) // use the 'check' wrapper to call the validation function return C.check(f, value.state.vm) == 1 }
// Bool ... func (value *basicValue) Bool() bool { C.js_getregistry(value.state.vm, value.ref) defer C.js_pop(value.state.vm, 1) return C.js_toboolean(value.state.vm, 0) == 1 }
// String ... func (value *basicValue) String() string { C.js_getregistry(value.state.vm, value.ref) defer C.js_pop(value.state.vm, 1) return C.GoString(C.js_tostring(value.state.vm, 0)) }
// Integer ... func (value *basicValue) Integer() int { C.js_getregistry(value.state.vm, value.ref) defer C.js_pop(value.state.vm, 1) return int(C.js_toint32(value.state.vm, 0)) }
// Float ... func (value *basicValue) Float() float64 { C.js_getregistry(value.state.vm, value.ref) defer C.js_pop(value.state.vm, 1) return float64(C.js_tonumber(value.state.vm, 0)) }