new isfunction api:
This commit is contained in:
@@ -239,7 +239,7 @@ JSC_SCALL(imgui_text, ImGui::Text("%s", str) )
|
||||
|
||||
JSC_SCALL(imgui_button,
|
||||
bool gogo = ImGui::Button(str);
|
||||
if (gogo && JS_IsFunction(js, argv[1]))
|
||||
if (gogo && JS_IsFunction(argv[1]))
|
||||
JS_Call(js, argv[1], JS_NULL, 0, NULL);
|
||||
ret = JS_NewBool(js, gogo);
|
||||
)
|
||||
|
||||
@@ -204,7 +204,7 @@ static JSValue js_transform_get_change_hook(JSContext *js, JSValueConst self)
|
||||
static JSValue js_transform_set_change_hook(JSContext *js, JSValueConst self, JSValue v)
|
||||
{
|
||||
transform *t = js2transform(js,self);
|
||||
if (!JS_IsNull(v) && !JS_IsFunction(js,v)) return JS_ThrowReferenceError(js, "Hook must be a function.");
|
||||
if (!JS_IsNull(v) && !JS_IsFunction(v)) return JS_ThrowReferenceError(js, "Hook must be a function.");
|
||||
JS_FreeValue(js,t->change_hook);
|
||||
t->change_hook = JS_DupValue(js,v);
|
||||
return JS_NULL;
|
||||
|
||||
Reference in New Issue
Block a user