1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-01-03 14:57:44 -05:00

[mujs] js_error in case of NULL in isEqualNode

This commit is contained in:
Witold Filipczyk 2024-09-17 16:50:23 +02:00
parent f96132d7ce
commit 1a7eec7f88
3 changed files with 18 additions and 3 deletions

View File

@ -2935,11 +2935,16 @@ mjs_element_isEqualNode(js_State *J)
dom_node *el = (dom_node *)(mjs_getprivate(J, 0));
if (!el) {
js_pushboolean(J, 0);
js_error(J, "error");
return;
}
dom_node *el2 = (dom_node *)(mjs_getprivate(J, 1));
if (!el2) {
js_error(J, "error");
return;
}
struct string first;
struct string second;

View File

@ -1075,11 +1075,16 @@ mjs_fragment_isEqualNode(js_State *J)
dom_node *el = (dom_node *)(mjs_getprivate_fragment(J, 0));
if (!el) {
js_pushboolean(J, 0);
js_error(J, "error");
return;
}
dom_node *el2 = (dom_node *)(mjs_getprivate_fragment(J, 1));
if (!el2) {
js_error(J, "error");
return;
}
struct string first;
struct string second;

View File

@ -1107,11 +1107,16 @@ mjs_text_isEqualNode(js_State *J)
dom_node *el = (dom_node *)(mjs_getprivate_text(J, 0));
if (!el) {
js_pushboolean(J, 0);
js_error(J, "error");
return;
}
dom_node *el2 = (dom_node *)(mjs_getprivate_text(J, 1));
if (!el2) {
js_error(J, "error");
return;
}
struct string first;
struct string second;