1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

[quickjs] More debug statements

This commit is contained in:
Witold Filipczyk 2024-08-08 17:48:59 +02:00
parent be7cd62625
commit 5e73db98bf
9 changed files with 60 additions and 0 deletions

View File

@ -128,6 +128,9 @@ void js_attr_finalizer(JSRuntime *rt, JSValue val)
attr_erase_from_map_str(map_attrs, node);
if (node) {
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(node);
}
}

View File

@ -98,6 +98,9 @@ next:
if (name) {
dom_string_unref(name);
}
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(attr);
JS_FreeValue(ctx, obj);
}
@ -166,6 +169,9 @@ js_attributes_item2(JSContext *ctx, JSValueConst this_val, int idx)
return JS_UNDEFINED;
}
ret = getAttr(ctx, attr);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(attr);
dom_namednodemap_unref(attrs);
@ -224,6 +230,9 @@ js_attributes_namedItem2(JSContext *ctx, JSValueConst this_val, const char *str)
return JS_UNDEFINED;
}
obj = getAttr(ctx, attr);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(attr);
dom_namednodemap_unref(attrs);

View File

@ -116,6 +116,9 @@ js_htmlCollection_item2(JSContext *ctx, JSValueConst this_val, int idx)
return JS_UNDEFINED;
}
ret = getElement(ctx, node);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(node);
dom_html_collection_unref(ns);
@ -184,6 +187,9 @@ js_htmlCollection_namedItem2(JSContext *ctx, JSValueConst this_val, const char *
JSValue ret = getElement(ctx, element);
dom_string_unref(val);
dom_string_unref(name);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
dom_html_collection_unref(ns);
@ -198,6 +204,9 @@ js_htmlCollection_namedItem2(JSContext *ctx, JSValueConst this_val, const char *
JSValue ret = getElement(ctx, element);
dom_string_unref(val);
dom_string_unref(name);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
dom_html_collection_unref(ns);
@ -205,6 +214,9 @@ js_htmlCollection_namedItem2(JSContext *ctx, JSValueConst this_val, const char *
}
dom_string_unref(val);
}
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
}
dom_string_unref(name);
@ -291,6 +303,9 @@ js_htmlCollection_set_items(JSContext *ctx, JSValue this_val, void *node)
if (name) {
dom_string_unref(name);
}
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
}
dom_html_collection_unref(ns);

View File

@ -121,6 +121,9 @@ js_htmlCollection2_item2(JSContext *ctx, JSValueConst this_val, int idx)
return JS_UNDEFINED;
}
ret = getElement(ctx, node);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(node);
dom_html_collection_unref(ns);
@ -189,6 +192,9 @@ js_htmlCollection2_namedItem2(JSContext *ctx, JSValueConst this_val, const char
JSValue ret = getElement(ctx, element);
dom_string_unref(val);
dom_string_unref(name);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
dom_html_collection_unref(ns);
@ -203,6 +209,9 @@ js_htmlCollection2_namedItem2(JSContext *ctx, JSValueConst this_val, const char
JSValue ret = getElement(ctx, element);
dom_string_unref(val);
dom_string_unref(name);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
dom_html_collection_unref(ns);
@ -210,6 +219,9 @@ js_htmlCollection2_namedItem2(JSContext *ctx, JSValueConst this_val, const char
}
dom_string_unref(val);
}
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
}
dom_string_unref(name);
@ -296,6 +308,9 @@ js_htmlCollection2_set_items(JSContext *ctx, JSValue this_val, void *node)
if (name) {
dom_string_unref(name);
}
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(element);
}
dom_html_collection_unref(ns);

View File

@ -205,6 +205,9 @@ js_customEvent_get_property_target(JSContext *ctx, JSValueConst this_val)
return JS_NULL;
}
JSValue r = getElement(ctx, target);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(target);
dom_event_unref(event);

View File

@ -37,6 +37,9 @@ js_dataset_finalizer(JSRuntime *rt, JSValue val)
dom_node *el = (dom_node *)(JS_GetOpaque(val, js_dataset_class_id));
if (el) {
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(el);
}
}
@ -221,6 +224,9 @@ getDataset(JSContext *ctx, void *node)
// JS_SetPropertyFunctionList(ctx, proto, js_dataset_proto_funcs, countof(js_dataset_proto_funcs));
JS_SetClassProto(ctx, js_dataset_class_id, proto);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_ref(node);
JS_SetOpaque(proto, node);
JSValue rr = JS_DupValue(ctx, proto);

View File

@ -165,6 +165,9 @@ js_event_get_property_target(JSContext *ctx, JSValueConst this_val)
return JS_NULL;
}
JSValue r = getElement(ctx, target);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(target);
//dom_event_unref(event);

View File

@ -256,6 +256,9 @@ js_keyboardEvent_get_property_target(JSContext *ctx, JSValueConst this_val)
return JS_NULL;
}
JSValue r = getElement(ctx, target);
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_unref(target);
dom_event_unref(event);

View File

@ -132,6 +132,9 @@ getNodeList2(JSContext *ctx, void *nodes)
int i = 0;
foreach (sn, *sni) {
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
#endif
dom_node_ref((dom_node *)(sn->node));
JSValue obj = getElement(ctx, sn->node);
REF_JS(obj);