mirror of
https://github.com/ccxvii/mujs.git
synced 2026-09-22 15:13:35 +08:00
Make array length helper public.
This commit is contained in:
@@ -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,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");
|
||||
|
||||
Reference in New Issue
Block a user