1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[mujs] No js_dup

This commit is contained in:
Witold Filipczyk 2022-08-18 21:56:08 +02:00
parent 716136efd9
commit 98120c7960

View File

@ -75,6 +75,8 @@ 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;
@ -83,15 +85,14 @@ mjs_attributes_set_items(js_State *J, void *node)
}
// TODO Check it
mjs_push_attr(J, attr);
js_dup(J);
js_setindex(J, -2, i);
xmlpp::ustring name = attr->get_name();
if (name != "" && name != "item" && name != "namedItem") {
mjs_push_attr(J, attr);
js_setproperty(J, -2, name.c_str());
}
js_pop(J, 1);
}
}