mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[quickjs] attributes static_cast
This commit is contained in:
parent
f856784cea
commit
44e9a23905
@ -129,7 +129,7 @@ static const JSCFunctionListEntry js_attr_proto_funcs[] = {
|
|||||||
JS_CFUNC_DEF("toString", 0, js_attr_toString)
|
JS_CFUNC_DEF("toString", 0, js_attr_toString)
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::map<void *, JSValueConst> map_attrs;
|
static std::map<const void *, JSValueConst> map_attrs;
|
||||||
|
|
||||||
static
|
static
|
||||||
void js_attr_finalizer(JSRuntime *rt, JSValue val)
|
void js_attr_finalizer(JSRuntime *rt, JSValue val)
|
||||||
@ -145,7 +145,7 @@ static JSClassDef js_attr_class = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
JSValue
|
JSValue
|
||||||
getAttr(JSContext *ctx, void *node)
|
getAttr(JSContext *ctx, const void *node)
|
||||||
{
|
{
|
||||||
#ifdef ECMASCRIPT_DEBUG
|
#ifdef ECMASCRIPT_DEBUG
|
||||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
#include <quickjs/quickjs.h>
|
#include <quickjs/quickjs.h>
|
||||||
|
|
||||||
JSValue getAttr(JSContext *ctx, void *node);
|
JSValue getAttr(JSContext *ctx, const void *node);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -83,9 +83,7 @@ js_attributes_set_items(JSContext *ctx, JSValue this_val, void *node)
|
|||||||
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS_GetContextOpaque(ctx);
|
struct ecmascript_interpreter *interpreter = (struct ecmascript_interpreter *)JS_GetContextOpaque(ctx);
|
||||||
assert(interpreter);
|
assert(interpreter);
|
||||||
|
|
||||||
int counter = 0;
|
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(node);
|
||||||
|
|
||||||
xmlpp::Element::AttributeList *al = node;
|
|
||||||
|
|
||||||
if (!al) {
|
if (!al) {
|
||||||
return;
|
return;
|
||||||
@ -129,7 +127,7 @@ js_attributes_get_property_length(JSContext *ctx, JSValueConst this_val)
|
|||||||
return JS_EXCEPTION;
|
return JS_EXCEPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
xmlpp::Element::AttributeList *al = js_attributes_GetOpaque(this_val);
|
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(js_attributes_GetOpaque(this_val));
|
||||||
|
|
||||||
if (!al) {
|
if (!al) {
|
||||||
return JS_NewInt32(ctx, 0);
|
return JS_NewInt32(ctx, 0);
|
||||||
@ -144,7 +142,7 @@ js_attributes_item2(JSContext *ctx, JSValueConst this_val, int idx)
|
|||||||
#ifdef ECMASCRIPT_DEBUG
|
#ifdef ECMASCRIPT_DEBUG
|
||||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
xmlpp::Element::AttributeList *al = js_attributes_GetOpaque(this_val);
|
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(js_attributes_GetOpaque(this_val));
|
||||||
|
|
||||||
if (!al) {
|
if (!al) {
|
||||||
return JS_UNDEFINED;
|
return JS_UNDEFINED;
|
||||||
@ -188,7 +186,7 @@ js_attributes_namedItem2(JSContext *ctx, JSValueConst this_val, const char *str)
|
|||||||
#ifdef ECMASCRIPT_DEBUG
|
#ifdef ECMASCRIPT_DEBUG
|
||||||
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
fprintf(stderr, "%s:%s\n", __FILE__, __FUNCTION__);
|
||||||
#endif
|
#endif
|
||||||
xmlpp::Element::AttributeList *al = js_attributes_GetOpaque(this_val);
|
xmlpp::Element::AttributeList *al = static_cast<xmlpp::Element::AttributeList *>(js_attributes_GetOpaque(this_val));
|
||||||
|
|
||||||
if (!al) {
|
if (!al) {
|
||||||
return JS_UNDEFINED;
|
return JS_UNDEFINED;
|
||||||
@ -256,6 +254,7 @@ static const JSCFunctionListEntry js_attributes_proto_funcs[] = {
|
|||||||
JS_CFUNC_DEF("toString", 0, js_attributes_toString)
|
JS_CFUNC_DEF("toString", 0, js_attributes_toString)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if 0
|
||||||
static void
|
static void
|
||||||
js_attributes_finalizer(JSRuntime *rt, JSValue val)
|
js_attributes_finalizer(JSRuntime *rt, JSValue val)
|
||||||
{
|
{
|
||||||
@ -270,6 +269,8 @@ static JSClassDef js_attributes_class = {
|
|||||||
js_attributes_finalizer
|
js_attributes_finalizer
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
JSValue
|
JSValue
|
||||||
getAttributes(JSContext *ctx, void *node)
|
getAttributes(JSContext *ctx, void *node)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user