mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-13 14:29:20 +03:00
Duktape element binding: Check dom_string_create for error.
This commit is contained in:
parent
a0fbf56a1d
commit
90fe920e07
@ -283,6 +283,9 @@ method Element::getAttribute()
|
|||||||
const char *s = duk_safe_to_lstring(ctx, 0, &slen);
|
const char *s = duk_safe_to_lstring(ctx, 0, &slen);
|
||||||
exc = dom_string_create((const uint8_t *)s, slen, &attr_name);
|
exc = dom_string_create((const uint8_t *)s, slen, &attr_name);
|
||||||
duk_pop(ctx);
|
duk_pop(ctx);
|
||||||
|
if (exc != DOM_NO_ERR) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
exc = dom_element_get_attribute(priv->parent.node,
|
exc = dom_element_get_attribute(priv->parent.node,
|
||||||
attr_name, &attr_value);
|
attr_name, &attr_value);
|
||||||
@ -336,6 +339,9 @@ method Element::hasAttribute()
|
|||||||
const char *s = duk_safe_to_lstring(ctx, 0, &slen);
|
const char *s = duk_safe_to_lstring(ctx, 0, &slen);
|
||||||
exc = dom_string_create((const uint8_t *)s, slen, &attr_name);
|
exc = dom_string_create((const uint8_t *)s, slen, &attr_name);
|
||||||
duk_pop(ctx);
|
duk_pop(ctx);
|
||||||
|
if (exc != DOM_NO_ERR) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
exc = dom_element_has_attribute(priv->parent.node,
|
exc = dom_element_has_attribute(priv->parent.node,
|
||||||
attr_name, &res);
|
attr_name, &res);
|
||||||
|
Loading…
Reference in New Issue
Block a user