1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

[js] id setter

This commit is contained in:
Witold Filipczyk 2021-06-03 13:57:33 +02:00
parent fc60848d64
commit 70cd635ef3

View File

@ -1420,7 +1420,6 @@ element_set_property_dir(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = JS_GetPrivate(hobj);
if (!el) {
return true;
@ -1461,6 +1460,14 @@ element_set_property_id(JSContext *ctx, unsigned int argc, JS::Value *vp)
return true;
}
xmlpp::Element *el = JS_GetPrivate(hobj);
if (!el) {
return true;
}
std::string value = JS_EncodeString(ctx, args[0].toString());
el->set_attribute("id", value);
return true;
}