mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[element] appendChild returns appended element
This commit is contained in:
parent
6b0fe3ec23
commit
4cf55496a1
@ -2389,7 +2389,7 @@ element_appendChild(JSContext *ctx, unsigned int argc, JS::Value *rval)
|
||||
xmlpp::Element *el = JS_GetPrivate(hobj);
|
||||
|
||||
if (!el) {
|
||||
args.rval().setBoolean(false);
|
||||
args.rval().setNull();
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -2398,6 +2398,13 @@ element_appendChild(JSContext *ctx, unsigned int argc, JS::Value *rval)
|
||||
el->import_node(el2);
|
||||
interpreter->changed = true;
|
||||
|
||||
JSObject *obj = getElement(ctx, el2);
|
||||
if (obj) {
|
||||
args.rval().setObject(*obj);
|
||||
} else {
|
||||
args.rval().setNull();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user