summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-03-23 14:55:29 (GMT)
committer Michael Drake <michael.drake@codethink.co.uk>2017-03-23 14:55:29 (GMT)
commitdd752ec19370014f7b222f4983c52ddbbe3e66cf (patch)
tree3534f08b2487148488520924ad70b4f4d46fb7bb
parentcdd1f8eacafb4e8510ae06e91668b9281396e655 (diff)
parent4ab82071ee417d4e82bfff8d3ca9619e3efc8b92 (diff)
downloadnsgenbind-dd752ec19370014f7b222f4983c52ddbbe3e66cf.tar.gz
nsgenbind-dd752ec19370014f7b222f4983c52ddbbe3e66cf.tar.bz2
Merge branch 'tlsa/duktape2'
-rw-r--r--src/duk-libdom-interface.c10
-rw-r--r--src/duk-libdom.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c
index 8741815..bb506c8 100644
--- a/src/duk-libdom-interface.c
+++ b/src/duk-libdom-interface.c
@@ -747,7 +747,7 @@ output_interface_prototype(FILE* outf,
GENBIND_METHOD_TYPE_PROTOTYPE);
/* prototype definition */
- fprintf(outf, "duk_ret_t %s_%s___proto(duk_context *ctx)\n",
+ fprintf(outf, "duk_ret_t %s_%s___proto(duk_context *ctx, void *udata)\n",
DLPFX, interfacee->class_name);
fprintf(outf,"{\n");
@@ -1025,7 +1025,7 @@ output_operation_argument_type_check(
case WEBIDL_TYPE_BOOL:
fprintf(outf,
"\t\tif (!duk_is_boolean(ctx, %d)) {\n"
- "\t\t\tduk_error(ctx, DUK_ERR_ERROR, %s_error_fmt_bool_type, %d, \"%s\");\n"
+ "\t\t\treturn duk_error(ctx, DUK_ERR_ERROR, %s_error_fmt_bool_type, %d, \"%s\");\n"
"\t\t}\n", argidx, DLPFX, argidx, argumente->name);
break;
@@ -1036,7 +1036,7 @@ output_operation_argument_type_check(
case WEBIDL_TYPE_LONGLONG:
fprintf(outf,
"\t\tif (!duk_is_number(ctx, %d)) {\n"
- "\t\t\tduk_error(ctx, DUK_ERR_ERROR, %s_error_fmt_number_type, %d, \"%s\");\n"
+ "\t\t\treturn duk_error(ctx, DUK_ERR_ERROR, %s_error_fmt_number_type, %d, \"%s\");\n"
"\t\t}\n", argidx, DLPFX, argidx, argumente->name);
break;
@@ -1106,7 +1106,7 @@ output_interface_operation(FILE* outf,
fprintf(outf,
"if (%s_argc < %d) {\n"
"\t\t/* not enough arguments */\n"
- "\t\tduk_error(ctx, DUK_RET_TYPE_ERROR, %s_error_fmt_argument, %d, %s_argc);\n"
+ "\t\treturn duk_error(ctx, DUK_RET_TYPE_ERROR, %s_error_fmt_argument, %d, %s_argc);\n"
"\t} else ",
DLPFX,
fixedargc,
@@ -1511,7 +1511,7 @@ int output_interface_declaration(FILE* outf, struct ir_entry *interfacee)
}
/* prototype declaration */
- fprintf(outf, "duk_ret_t %s_%s___proto(duk_context *ctx);\n",
+ fprintf(outf, "duk_ret_t %s_%s___proto(duk_context *ctx, void *udata);\n",
DLPFX, interfacee->class_name);
/* if the interface has no references (no other interface inherits from
diff --git a/src/duk-libdom.c b/src/duk-libdom.c
index bf27007..96b11d5 100644
--- a/src/duk-libdom.c
+++ b/src/duk-libdom.c
@@ -441,7 +441,7 @@ output_binding_src(struct ir *ir)
"{\n"
"\tduk_int_t ret;\n"
"\tduk_push_object(ctx);\n"
- "\tif ((ret = duk_safe_call(ctx, genproto, 1, 1)) != DUK_EXEC_SUCCESS) {\n"
+ "\tif ((ret = duk_safe_call(ctx, genproto, NULL, 1, 1)) != DUK_EXEC_SUCCESS) {\n"
"\t\tduk_pop(ctx);\n"
"\t\tLOG(\"Failed to register prototype for %%s\", proto_name + 2);\n"
"\t\treturn ret;\n"