1
0
mirror of https://github.com/rkd77/elinks.git synced 2025-02-02 15:09:23 -05:00

[quickjs] Removed map_elements

This commit is contained in:
Witold Filipczyk 2024-10-25 17:31:10 +02:00
parent b5997d4fa8
commit 3064db9331
4 changed files with 0 additions and 27 deletions

View File

@ -59,9 +59,6 @@ js_html_document_user_data_handler(dom_node_operation operation,
if (map_privates) {
attr_erase_from_map(map_privates, data);
}
if (map_elements) {
attr_erase_from_map(map_elements, data);
}
#endif
//fprintf(stderr, "DELETED: data=%p src=%p dst=%p\n", data, src, dst);
/* This is the only path I expect */

View File

@ -158,7 +158,6 @@ quickjs_init(struct module *module)
map_attributes = attr_create_new_attributes_map();
map_rev_attributes = attr_create_new_attributes_map_rev();
map_doctypes = attr_create_new_doctypes_map();
map_elements = attr_create_new_elements_map();
map_privates = attr_create_new_privates_map_void();
map_form = attr_create_new_form_map();
map_form_rev = attr_create_new_form_map_rev();
@ -193,8 +192,6 @@ quickjs_done(struct module *xxx)
attr_delete_map(map_attributes);
attr_delete_map_rev(map_rev_attributes);
attr_delete_map(map_doctypes);
attr_delete_map(map_elements);
map_elements = NULL;
attr_delete_map_void(map_privates);
map_privates = NULL;
attr_delete_map(map_form);

View File

@ -3858,9 +3858,6 @@ static const JSCFunctionListEntry js_element_proto_funcs[] = {
JS_CFUNC_DEF("toString", 0, js_element_toString)
};
void *map_elements;
//static std::map<void *, JSValueConst> map_elements;
static
void js_element_finalizer(JSRuntime *rt, JSValue val)
{
@ -3899,7 +3896,6 @@ fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
free_list(el_private->listeners);
JS_FreeValueRT(rt, el_private->thisval);
attr_erase_from_map_str(map_elements, el_private->node);
mem_free(el_private);
}
}
@ -3963,21 +3959,6 @@ getElement(JSContext *ctx, void *node)
#ifdef ECMASCRIPT_DEBUG
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
#endif
// JSValue second;
// static int initialized;
// /* create the element class */
// if (!initialized) {
// JS_NewClassID(&js_element_class_id);
// JS_NewClass(JS_GetRuntime(ctx), js_element_class_id, &js_element_class);
// initialized = 1;
// }
// second = attr_find_in_map(map_elements, node);
//
// if (!JS_IsNull(second)) {
// JSValue r = JS_DupValue(ctx, second);
// RETURN_JS(r);
// }
struct js_element_private *el_private = (struct js_element_private *)mem_calloc(1, sizeof(*el_private));
if (!el_private) {
@ -3999,7 +3980,6 @@ fprintf(stderr, "Before: %s:%d\n", __FUNCTION__, __LINE__);
dom_node_ref((dom_node *)node);
JS_SetOpaque(element_obj, el_private);
attr_save_in_map(map_elements, node, element_obj);
attr_save_in_map_void(map_privates, node, el_private);
void *old_node_data = NULL;

View File

@ -13,7 +13,6 @@ extern void *map_attrs;
extern void *map_attributes;
extern void *map_rev_attributes;
extern void *map_doctypes;
extern void *map_elements;
extern void *map_privates;
extern void *map_form;
extern void *map_form_rev;