diff --git a/js.h b/js.h index 26833fd..5f7147f 100644 --- a/js.h +++ b/js.h @@ -97,6 +97,8 @@ void js_defproperty(js_State *J, int idx, const char *name, int atts); void js_delproperty(js_State *J, int idx, const char *name); void js_defaccessor(js_State *J, int idx, const char *name, int atts); +unsigned int js_getlength(js_State *J, int idx); +void js_setlength(js_State *J, int idx, unsigned int len); int js_hasindex(js_State *J, int idx, unsigned int i); void js_getindex(js_State *J, int idx, unsigned int i); void js_setindex(js_State *J, int idx, unsigned int i); diff --git a/jsarray.c b/jsarray.c index 7073258..1950794 100644 --- a/jsarray.c +++ b/jsarray.c @@ -2,7 +2,7 @@ #include "jsvalue.h" #include "jsbuiltin.h" -static unsigned int js_getlength(js_State *J, int idx) +unsigned int js_getlength(js_State *J, int idx) { unsigned int len; js_getproperty(J, idx, "length"); @@ -11,7 +11,7 @@ static unsigned int js_getlength(js_State *J, int idx) return len; } -static void js_setlength(js_State *J, int idx, unsigned int len) +void js_setlength(js_State *J, int idx, unsigned int len) { js_pushnumber(J, len); js_setproperty(J, idx, "length");