From c350650cc4f6292c09eb5f75bcdd7a4e04747b95 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 30 Jan 2022 13:27:58 +0100 Subject: [PATCH] [quickjs] nodelist fixes --- src/ecmascript/quickjs/nodelist.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/ecmascript/quickjs/nodelist.c b/src/ecmascript/quickjs/nodelist.c index d843d3db..60befe49 100644 --- a/src/ecmascript/quickjs/nodelist.c +++ b/src/ecmascript/quickjs/nodelist.c @@ -75,13 +75,14 @@ js_nodeList_SetOpaque(JSValueConst this_val, void *node) } } +#if 0 static JSValue js_nodeList_get_property_length(JSContext *ctx, JSValueConst this_val) { #ifdef ECMASCRIPT_DEBUG fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - xmlpp::Node::NodeList *nl = js_nodeList_GetOpaque(this_val); + xmlpp::Node::NodeList *nl = static_cast(js_nodeList_GetOpaque(this_val)); if (!nl) { return JS_NewInt32(ctx, 0); @@ -89,6 +90,7 @@ js_nodeList_get_property_length(JSContext *ctx, JSValueConst this_val) return JS_NewInt32(ctx, nl->size()); } +#endif static JSValue js_nodeList_item2(JSContext *ctx, JSValueConst this_val, int idx) @@ -96,13 +98,13 @@ js_nodeList_item2(JSContext *ctx, JSValueConst this_val, int idx) #ifdef ECMASCRIPT_DEBUG fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - xmlpp::Node::NodeList *nl = js_nodeList_GetOpaque(this_val); + xmlpp::Node::NodeList *nl = static_cast(js_nodeList_GetOpaque(this_val)); if (!nl) { return JS_UNDEFINED; } - xmlpp::Element *element = nullptr; + xmlpp::Node *element = nullptr; auto it = nl->begin(); auto end = nl->end(); @@ -143,7 +145,7 @@ js_nodeList_set_items(JSContext *ctx, JSValue this_val, void *node) fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__); #endif - xmlpp::Node::NodeList *nl = node; + xmlpp::Node::NodeList *nl = static_cast(node); if (!nl) { return; @@ -152,7 +154,7 @@ js_nodeList_set_items(JSContext *ctx, JSValue this_val, void *node) auto it = nl->begin(); auto end = nl->end(); for (int i = 0; it != end; ++it, ++i) { - xmlpp::Element *element = *it; + xmlpp::Node *element = *it; if (element) { JSValue obj = getElement(ctx, element); @@ -177,6 +179,7 @@ static const JSCFunctionListEntry js_nodeList_proto_funcs[] = { JS_CFUNC_DEF("toString", 0, js_nodeList_toString) }; +#if 0 static void js_nodeList_finalizer(JSRuntime *rt, JSValue val) { @@ -190,6 +193,7 @@ static JSClassDef js_nodeList_class = { "nodeList", js_nodeList_finalizer }; +#endif JSValue getNodeList(JSContext *ctx, void *node)