mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[quickjs] Check NULL in isEqualNode
This commit is contained in:
parent
894a37ec65
commit
f96132d7ce
@ -3347,12 +3347,18 @@ js_element_isEqualNode(JSContext *ctx, JSValueConst this_val, int argc, JSValueC
|
||||
dom_node *el = (dom_node *)(js_getopaque(this_val, js_element_class_id));
|
||||
|
||||
if (!el) {
|
||||
return JS_FALSE;
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
dom_node *el2 = NULL;
|
||||
//dom_node_ref(el);
|
||||
|
||||
JSValue node = argv[0];
|
||||
dom_node *el2 = (dom_node *)(js_getopaque(node, js_element_class_id));
|
||||
if (!JS_IsNull(argv[0])) {
|
||||
el2 = (dom_node *)(js_getopaque(argv[0], js_element_class_id));
|
||||
}
|
||||
|
||||
if (!el2) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
struct string first;
|
||||
struct string second;
|
||||
|
@ -1285,12 +1285,18 @@ js_fragment_isEqualNode(JSContext *ctx, JSValueConst this_val, int argc, JSValue
|
||||
dom_node *el = (dom_node *)(js_getopaque_fragment(this_val, js_fragment_class_id));
|
||||
|
||||
if (!el) {
|
||||
return JS_FALSE;
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
//dom_node_ref(el);
|
||||
dom_node *el2 = NULL;
|
||||
|
||||
JSValue node = argv[0];
|
||||
dom_node *el2 = (dom_node *)(js_getopaque_fragment(node, js_fragment_class_id));
|
||||
if (!JS_IsNull(argv[0])) {
|
||||
el2 = (dom_node *)(js_getopaque_fragment(argv[0], js_fragment_class_id));
|
||||
}
|
||||
|
||||
if (!el2) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
struct string first;
|
||||
struct string second;
|
||||
|
@ -1318,12 +1318,18 @@ js_text_isEqualNode(JSContext *ctx, JSValueConst this_val, int argc, JSValueCons
|
||||
dom_node *el = (dom_node *)(js_getopaque_text(this_val, js_text_class_id));
|
||||
|
||||
if (!el) {
|
||||
return JS_FALSE;
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
//dom_node_ref(el);
|
||||
dom_node *el2 = NULL;
|
||||
|
||||
JSValue node = argv[0];
|
||||
dom_node *el2 = (dom_node *)(js_getopaque_text(node, js_text_class_id));
|
||||
if (!JS_IsNull(argv[0])) {
|
||||
el2 = (dom_node *)(js_getopaque_text(argv[0], js_text_class_id));
|
||||
}
|
||||
|
||||
if (!el2) {
|
||||
return JS_EXCEPTION;
|
||||
}
|
||||
|
||||
struct string first;
|
||||
struct string second;
|
||||
|
Loading…
x
Reference in New Issue
Block a user