From c260593486213c84521b23b40759800e4a312db9 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 14 Oct 2015 21:01:15 +0100 Subject: Fix putforwards generation to cope with getters leaving a dirty stack Kinnison did all teh heavy tjinking on this! --- src/duk-libdom-interface.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/duk-libdom-interface.c b/src/duk-libdom-interface.c index 66834b3..a52d25b 100644 --- a/src/duk-libdom-interface.c +++ b/src/duk-libdom-interface.c @@ -1394,17 +1394,16 @@ output_putforwards_setter(FILE* outf, "\tif (get_ret != 1) {\n" "\t\treturn 0;\n" "\t}\n\n" - "\t/* parameter attribute */\n\n" - "\tduk_swap(ctx, 0, 1);\n" - "\t/* attribute parameter */\n\n" + "\t/* parameter ... attribute */\n\n" + "\tduk_dup(ctx, 0);\n" + "\t/* ... attribute parameter */\n\n" "\t/* call the putforward */\n"); fprintf(outf, - "\tduk_put_prop_string(ctx, 0, \"%s\");\n\n", + "\tduk_put_prop_string(ctx, -2, \"%s\");\n\n", atributee->putforwards); fprintf(outf, - "\tduk_pop(ctx);\n\n" "\treturn 0;\n"); return 0; -- cgit v1.2.3