1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[spidermonkey] Check NULL in isEqualNode

This commit is contained in:
Witold Filipczyk 2024-09-17 16:40:19 +02:00
parent 82b2f85a78
commit 894a37ec65
3 changed files with 33 additions and 12 deletions

View File

@ -4831,11 +4831,18 @@ element_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(hobj, 0);
if (!el) {
args.rval().setBoolean(false);
return true;
return false;
}
dom_node *el2 = NULL;
if (!args[0].isNull()) {
JS::RootedObject node(ctx, &args[0].toObject());
el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(node, 0);
}
if (!el2) {
return false;
}
JS::RootedObject node(ctx, &args[0].toObject());
dom_node *el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(node, 0);
struct string first;
struct string second;

View File

@ -2010,11 +2010,18 @@ fragment_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(hobj, 0);
if (!el) {
args.rval().setBoolean(false);
return true;
return false;
}
dom_node *el2 = NULL;
if (!args[0].isNull()) {
JS::RootedObject node(ctx, &args[0].toObject());
el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(node, 0);
}
if (!el2) {
return false;
}
JS::RootedObject node(ctx, &args[0].toObject());
dom_node *el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(node, 0);
struct string first;
struct string second;

View File

@ -2074,11 +2074,18 @@ text_isEqualNode(JSContext *ctx, unsigned int argc, JS::Value *rval)
dom_node *el = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(hobj, 0);
if (!el) {
args.rval().setBoolean(false);
return true;
return false;
}
dom_node *el2 = NULL;
if (!args[0].isNull()) {
JS::RootedObject node(ctx, &args[0].toObject());
el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(node, 0);
}
if (!el2) {
return false;
}
JS::RootedObject node(ctx, &args[0].toObject());
dom_node *el2 = (dom_node *)JS::GetMaybePtrFromReservedSlot<dom_node>(node, 0);
struct string first;
struct string second;