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:
parent
82b2f85a78
commit
894a37ec65
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user