diff --git a/src/ecmascript/mujs/attributes.cpp b/src/ecmascript/mujs/attributes.cpp index 8d82590e..06a584fc 100644 --- a/src/ecmascript/mujs/attributes.cpp +++ b/src/ecmascript/mujs/attributes.cpp @@ -75,8 +75,6 @@ mjs_attributes_set_items(js_State *J, void *node) auto end = al->end(); int i = 0; - js_newarray(J); - for (;it != end; ++it, ++i) { xmlpp::Attribute *attr = *it; @@ -225,7 +223,7 @@ mjs_push_attributes(js_State *J, void *node) #ifdef ECMASCRIPT_DEBUG fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - js_newobject(J); + js_newarray(J); { js_newuserdata(J, "attribute", node, mjs_attributes_finalizer); addmethod(J, "item", mjs_attributes_item, 1); diff --git a/src/ecmascript/mujs/form.cpp b/src/ecmascript/mujs/form.cpp index 98fbc533..0a44b880 100644 --- a/src/ecmascript/mujs/form.cpp +++ b/src/ecmascript/mujs/form.cpp @@ -119,8 +119,6 @@ mjs_form_set_items(js_State *J, void *node) int counter = 0; struct el_form_control *fc; - js_newarray(J); - foreach (fc, form->items) { struct form_state *fs = find_form_state(doc_view, fc); @@ -158,8 +156,6 @@ mjs_form_set_items2(js_State *J, void *node) int counter = 0; struct el_form_control *fc; - js_newarray(J); - foreach (fc, form->items) { struct form_state *fs = find_form_state(doc_view, fc); @@ -434,7 +430,7 @@ mjs_elements_finalizer(js_State *J, void *node) void mjs_push_form_elements(js_State *J, struct form_view *fv) { - js_newobject(J); + js_newarray(J); { js_newuserdata(J, "form_view", fv, mjs_elements_finalizer); @@ -824,7 +820,7 @@ mjs_push_form_object(js_State *J, struct form *form) #ifdef ECMASCRIPT_DEBUG fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - js_newobject(J); + js_newarray(J); { js_newuserdata(J, "form", form, mjs_form_finalizer); diff --git a/src/ecmascript/mujs/forms.cpp b/src/ecmascript/mujs/forms.cpp index 2e48b6d1..7cc04300 100644 --- a/src/ecmascript/mujs/forms.cpp +++ b/src/ecmascript/mujs/forms.cpp @@ -95,8 +95,6 @@ mjs_forms_set_items(js_State *J) int counter = 0; struct form_view *fv; - js_newarray(J); - foreach (fv, vs->forms) { struct form *form = find_form_by_form_view(document, fv); @@ -208,7 +206,7 @@ mjs_push_forms(js_State *J, void *node) fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - js_newobject(J); + js_newarray(J); { js_newuserdata(J, "forms", node, NULL);