mirror of
https://github.com/ccxvii/mujs.git
synced 2026-02-06 01:41:37 +08:00
Add js_isbooleanobject and js_isdateobject functions.
This commit is contained in:
10
json.c
10
json.c
@@ -15,6 +15,16 @@ int js_isstringobject(js_State *J, int idx)
|
|||||||
return js_isobject(J, idx) && js_toobject(J, idx)->type == JS_CSTRING;
|
return js_isobject(J, idx) && js_toobject(J, idx)->type == JS_CSTRING;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int js_isbooleanobject(js_State *J, int idx)
|
||||||
|
{
|
||||||
|
return js_isobject(J, idx) && js_toobject(J, idx)->type == JS_CBOOLEAN;
|
||||||
|
}
|
||||||
|
|
||||||
|
int js_isdateobject(js_State *J, int idx)
|
||||||
|
{
|
||||||
|
return js_isobject(J, idx) && js_toobject(J, idx)->type == JS_CDATE;
|
||||||
|
}
|
||||||
|
|
||||||
static void jsonnext(js_State *J)
|
static void jsonnext(js_State *J)
|
||||||
{
|
{
|
||||||
J->lookahead = jsY_lexjson(J);
|
J->lookahead = jsY_lexjson(J);
|
||||||
|
|||||||
2
mujs.h
2
mujs.h
@@ -198,6 +198,8 @@ int js_isuserdata(js_State *J, int idx, const char *tag);
|
|||||||
int js_iserror(js_State *J, int idx);
|
int js_iserror(js_State *J, int idx);
|
||||||
int js_isnumberobject(js_State *J, int idx);
|
int js_isnumberobject(js_State *J, int idx);
|
||||||
int js_isstringobject(js_State *J, int idx);
|
int js_isstringobject(js_State *J, int idx);
|
||||||
|
int js_isbooleanobject(js_State *J, int idx);
|
||||||
|
int js_isdateobject(js_State *J, int idx);
|
||||||
|
|
||||||
int js_toboolean(js_State *J, int idx);
|
int js_toboolean(js_State *J, int idx);
|
||||||
double js_tonumber(js_State *J, int idx);
|
double js_tonumber(js_State *J, int idx);
|
||||||
|
|||||||
Reference in New Issue
Block a user