shithub: libmujs

Download patch

ref: 7bab97a7d86415598ae7b18cf693c22f54de7fb6
parent: 8f7c64998581b5ee3889e6d847fdb1164fdf4d5c
author: Tor Andersson <tor.andersson@artifex.com>
date: Thu Jun 12 09:42:48 EDT 2014

Tweak argument order in js_is/touserdata.

--- a/jsrun.c
+++ b/jsrun.c
@@ -194,7 +194,7 @@
 	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_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)
--- a/mujs.h
+++ b/mujs.h
@@ -137,12 +137,12 @@
 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);