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:
parent
fc60848d64
commit
70cd635ef3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user