Tweak argument order in js_is/touserdata.

This commit is contained in:
Tor Andersson
2014-06-12 13:42:48 +02:00
parent 8f7c649985
commit 7bab97a7d8
2 changed files with 4 additions and 4 deletions

View File

@@ -194,7 +194,7 @@ int js_isiterator(js_State *J, int idx)
return v->type == JS_TOBJECT && v->u.object->type == JS_CITERATOR;
}
int js_isuserdata(js_State *J, const char *tag, int idx)
int js_isuserdata(js_State *J, int idx, const char *tag)
{
const js_Value *v = stackidx(J, idx);
if (v->type == JS_TOBJECT && v->u.object->type == JS_CUSERDATA)
@@ -282,7 +282,7 @@ js_Regexp *js_toregexp(js_State *J, int idx)
js_typeerror(J, "not a regexp");
}
void *js_touserdata(js_State *J, const char *tag, int idx)
void *js_touserdata(js_State *J, int idx, const char *tag)
{
const js_Value *v = stackidx(J, idx);
if (v->type == JS_TOBJECT && v->u.object->type == JS_CUSERDATA)

4
mujs.h
View File

@@ -137,12 +137,12 @@ int js_isobject(js_State *J, int idx);
int js_isarray(js_State *J, int idx);
int js_isregexp(js_State *J, int idx);
int js_iscallable(js_State *J, int idx);
int js_isuserdata(js_State *J, const char *tag, int idx);
int js_isuserdata(js_State *J, int idx, const char *tag);
int js_toboolean(js_State *J, int idx);
double js_tonumber(js_State *J, int idx);
const char *js_tostring(js_State *J, int idx);
void *js_touserdata(js_State *J, const char *tag, int idx);
void *js_touserdata(js_State *J, int idx, const char *tag);
double js_tointeger(js_State *J, int idx);
int js_toint32(js_State *J, int idx);