mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
[mujs] js_error in case of NULL in isEqualNode
This commit is contained in:
parent
f96132d7ce
commit
1a7eec7f88
@ -2935,11 +2935,16 @@ mjs_element_isEqualNode(js_State *J)
|
|||||||
dom_node *el = (dom_node *)(mjs_getprivate(J, 0));
|
dom_node *el = (dom_node *)(mjs_getprivate(J, 0));
|
||||||
|
|
||||||
if (!el) {
|
if (!el) {
|
||||||
js_pushboolean(J, 0);
|
js_error(J, "error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dom_node *el2 = (dom_node *)(mjs_getprivate(J, 1));
|
dom_node *el2 = (dom_node *)(mjs_getprivate(J, 1));
|
||||||
|
|
||||||
|
if (!el2) {
|
||||||
|
js_error(J, "error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct string first;
|
struct string first;
|
||||||
struct string second;
|
struct string second;
|
||||||
|
|
||||||
|
@ -1075,11 +1075,16 @@ mjs_fragment_isEqualNode(js_State *J)
|
|||||||
dom_node *el = (dom_node *)(mjs_getprivate_fragment(J, 0));
|
dom_node *el = (dom_node *)(mjs_getprivate_fragment(J, 0));
|
||||||
|
|
||||||
if (!el) {
|
if (!el) {
|
||||||
js_pushboolean(J, 0);
|
js_error(J, "error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dom_node *el2 = (dom_node *)(mjs_getprivate_fragment(J, 1));
|
dom_node *el2 = (dom_node *)(mjs_getprivate_fragment(J, 1));
|
||||||
|
|
||||||
|
if (!el2) {
|
||||||
|
js_error(J, "error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct string first;
|
struct string first;
|
||||||
struct string second;
|
struct string second;
|
||||||
|
|
||||||
|
@ -1107,11 +1107,16 @@ mjs_text_isEqualNode(js_State *J)
|
|||||||
dom_node *el = (dom_node *)(mjs_getprivate_text(J, 0));
|
dom_node *el = (dom_node *)(mjs_getprivate_text(J, 0));
|
||||||
|
|
||||||
if (!el) {
|
if (!el) {
|
||||||
js_pushboolean(J, 0);
|
js_error(J, "error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
dom_node *el2 = (dom_node *)(mjs_getprivate_text(J, 1));
|
dom_node *el2 = (dom_node *)(mjs_getprivate_text(J, 1));
|
||||||
|
|
||||||
|
if (!el2) {
|
||||||
|
js_error(J, "error");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
struct string first;
|
struct string first;
|
||||||
struct string second;
|
struct string second;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user