summaryrefslogtreecommitdiff
path: root/src/duk-libdom.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2015-08-04 10:30:01 +0100
committerVincent Sanders <vince@kyllikki.org>2015-08-04 10:30:01 +0100
commit5af5647471a44f489f14a415f10b7b8e34344581 (patch)
tree2d606faea06a9413851915347d1ab9d6212b8598 /src/duk-libdom.c
parenta3224e5daea03c4dbf28a2d6a5c0ddb3ece1ed0a (diff)
downloadnsgenbind-5af5647471a44f489f14a415f10b7b8e34344581.tar.gz
nsgenbind-5af5647471a44f489f14a415f10b7b8e34344581.tar.bz2
The Read-only properties generator was using the wrong number of parameters.
Diffstat (limited to 'src/duk-libdom.c')
-rw-r--r--src/duk-libdom.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/duk-libdom.c b/src/duk-libdom.c
index 2361448..6966f02 100644
--- a/src/duk-libdom.c
+++ b/src/duk-libdom.c
@@ -193,16 +193,15 @@ output_populate_rw_property(FILE* outf, const char *class_name, const char *prop
fprintf(outf, "\t/* Add read/write property */\n");
fprintf(outf, "\tduk_dup(ctx, 0);\n");
fprintf(outf, "\tduk_push_string(ctx, \"%s\");\n", property);
- fprintf(outf,
- "\tduk_push_c_function(ctx, %s_%s_%s_getter, 0);\n",
+ fprintf(outf, "\tduk_push_c_function(ctx, %s_%s_%s_getter, 0);\n",
DLPFX, class_name, property);
- fprintf(outf,
- "\tduk_push_c_function(ctx, %s_%s_%s_setter, 1);\n",
+ fprintf(outf, "\tduk_push_c_function(ctx, %s_%s_%s_setter, 1);\n",
DLPFX, class_name, property);
+ output_dump_stack(outf);
fprintf(outf, "\tduk_def_prop(ctx, -4, DUK_DEFPROP_HAVE_GETTER |\n");
- fprintf(outf, "\t DUK_DEFPROP_HAVE_SETTER |\n");
- fprintf(outf, "\t DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_ENUMERABLE |\n");
- fprintf(outf, "\t DUK_DEFPROP_HAVE_CONFIGURABLE);\n");
+ fprintf(outf, "\t\tDUK_DEFPROP_HAVE_SETTER |\n");
+ fprintf(outf, "\t\tDUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_ENUMERABLE |\n");
+ fprintf(outf, "\t\tDUK_DEFPROP_HAVE_CONFIGURABLE);\n");
fprintf(outf, "\tduk_pop(ctx);\n\n");
return 0;
@@ -217,13 +216,12 @@ output_populate_ro_property(FILE* outf, const char *class_name, const char *prop
fprintf(outf, "\t/* Add readonly property */\n");
fprintf(outf, "\tduk_dup(ctx, 0);\n");
fprintf(outf, "\tduk_push_string(ctx, \"%s\");\n", property);
- fprintf(outf,
- "\tduk_push_c_function(ctx, %s_%s_%s_getter, 0);\n",
+ fprintf(outf, "\tduk_push_c_function(ctx, %s_%s_%s_getter, 0);\n",
DLPFX, class_name, property);
- fprintf(outf,
- "\tduk_def_prop(ctx, -4, DUK_DEFPROP_HAVE_GETTER |\n");
- fprintf(outf, "\t DUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_ENUMERABLE |\n");
- fprintf(outf, "\t DUK_DEFPROP_HAVE_CONFIGURABLE);\n");
+ output_dump_stack(outf);
+ fprintf(outf, "\tduk_def_prop(ctx, -3, DUK_DEFPROP_HAVE_GETTER |\n");
+ fprintf(outf, "\t\tDUK_DEFPROP_HAVE_ENUMERABLE | DUK_DEFPROP_ENUMERABLE |\n");
+ fprintf(outf, "\t\tDUK_DEFPROP_HAVE_CONFIGURABLE);\n");
fprintf(outf, "\tduk_pop(ctx);\n\n");
return 0;
@@ -258,7 +256,13 @@ output_get_method_private(FILE* outf, char *class_name)
MAGICPFX);
fprintf(outf, "\tpriv = duk_get_pointer(ctx, -1);\n");
fprintf(outf, "\tduk_pop_2(ctx);\n");
- fprintf(outf, "\tif (priv == NULL) return 0; /* can do? No can do. */\n\n");
+ fprintf(outf, "\tif (priv == NULL) {\n");
+ if (options->dbglog) {
+ fprintf(outf, "\t\tLOG(\"priv failed\");\n");
+ }
+ fprintf(outf, "\t\treturn 0; /* can do? No can do. */\n");
+ fprintf(outf, "\t}\n\n");
+
return 0;
}