From 21e75fa945b5f431205640e88e7cff4907af2110 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 24 Oct 2012 14:08:15 +0100 Subject: fix basic bugs code generation --- src/jsapi-libdom-operator.c | 4 ++-- src/jsapi-libdom.c | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/jsapi-libdom-operator.c b/src/jsapi-libdom-operator.c index 0ff79c0..e937fa0 100644 --- a/src/jsapi-libdom-operator.c +++ b/src/jsapi-libdom-operator.c @@ -205,7 +205,7 @@ output_operation_input(struct binding *binding, /* JSBool */ fprintf(binding->outfile, "\tif (!JS_ValueToBoolean(cx, argv[%d], &%s)) {\n" - "\t\treturn JS_FALSE\n" + "\t\treturn JS_FALSE;\n" "\t}\n", arg_cur, webidl_node_gettext(arg_ident)); @@ -240,7 +240,7 @@ output_operation_input(struct binding *binding, fprintf(binding->outfile, "\t%1$s_jsstr = JS_ValueToString(cx, argv[%2$d]);\n" "\tif (%1$s_jsstr == NULL) {\n" - "\t\treturn JS_FALSE\n" + "\t\treturn JS_FALSE;\n" "\t}\n\n" "\tJSString_to_char(%1$s_jsstr, %1$s, %1$s_len);\n", webidl_node_gettext(arg_ident), diff --git a/src/jsapi-libdom.c b/src/jsapi-libdom.c index 1dad62a..e5a8173 100644 --- a/src/jsapi-libdom.c +++ b/src/jsapi-libdom.c @@ -483,6 +483,13 @@ output_property_body(struct binding *binding, const char *interface) static int output_jsclass(struct binding *binding) { + /* forward declare the resolver and finalizer */ + fprintf(binding->outfile, + "static void jsclass_finalize(JSContext *cx, JSObject *obj);"); + fprintf(binding->outfile, + "static JSBool jsclass_resolve(JSContext *cx, JSObject *obj, jsval id, uintN flags, JSObject **objp);"); + + /* output the class */ fprintf(binding->outfile, "static JSClass jsclass_object =\n" "{\n" @@ -493,7 +500,7 @@ output_jsclass(struct binding *binding) " JS_PropertyStub,\n" " JS_StrictPropertyStub,\n" " JS_EnumerateStub,\n" - " (JSResolveOp)jsresove_node,\n" + " (JSResolveOp)jsclass_resolve,\n" " JS_ConvertStub,\n" " jsclass_finalize,\n" " JSCLASS_NO_OPTIONAL_MEMBERS\n" -- cgit v1.2.3