Make array length helper public.

This commit is contained in:
Tor Andersson
2014-02-13 12:06:27 +01:00
parent 759d609588
commit 9f7141ce30
2 changed files with 4 additions and 2 deletions
+2
View File
@@ -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);
+2 -2
View File
@@ -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");