summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2017-03-22 14:58:49 (GMT)
committer Michael Drake <michael.drake@codethink.co.uk>2017-03-22 15:02:01 (GMT)
commit4ab82071ee417d4e82bfff8d3ca9619e3efc8b92 (patch)
tree3534f08b2487148488520924ad70b4f4d46fb7bb
parent632a75e6c2a965d984c1495750bfca47931cec94 (diff)
downloadnsgenbind-tlsa/duktape2.tar.gz
nsgenbind-tlsa/duktape2.tar.bz2
Operation generation: When argument type errors are detected, treat as error.tlsa/duktape2
-rw-r--r--src/duk-libdom-interface.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c
index 5b15164..bb506c8 100644
--- a/src/duk-libdom-interface.c
+++ b/src/duk-libdom-interface.c
@@ -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\t(void) duk_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\t(void) duk_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\t(void) duk_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,