Skip to content

Instantly share code, notes, and snippets.

@unxmaal
Created June 29, 2021 13:35
Show Gist options
  • Save unxmaal/b48202329f48e7c7f71d00a22873834d to your computer and use it in GitHub Desktop.
Save unxmaal/b48202329f48e7c7f71d00a22873834d to your computer and use it in GitHub Desktop.
char skiptest[100];
sprintf(skiptest, "corestring_dom_%s", atributee->name + 2);
if (strcmp(skiptest, "corestring_dom_select")) {
outputf(outc,
"\t/* handlerfn */\n"
"\tduk_push_this(ctx);\n"
"\t/* handlerfn this */\n"
"\tduk_get_prop_string(ctx, -1, HANDLER_MAGIC);\n"
"\t/* handlerfn this handlers */\n"
"\tduk_push_lstring(ctx, \"%s\", %ld);\n"
"\t/* handlerfn this handlers %s */\n"
"\tduk_dup(ctx, -4);\n"
"\t/* handlerfn this handlers %s handlerfn */\n"
"\tduk_put_prop(ctx, -3);\n"
"\t/* handlerfn this handlers */\n"
"\tdukky_register_event_listener_for(ctx, et,\n"
"\t\tcorestring_dom_%sed, false);\n"
"\treturn 0;\n",
atributee->name + 2,
strlen(atributee->name + 2),
atributee->name + 2,
atributee->name + 2,
atributee->name + 2);
} else {
outputf(outc,
"\t/* handlerfn */\n"
"\tduk_push_this(ctx);\n"
"\t/* handlerfn this */\n"
"\tduk_get_prop_string(ctx, -1, HANDLER_MAGIC);\n"
"\t/* handlerfn this handlers */\n"
"\tduk_push_lstring(ctx, \"%s\", %ld);\n"
"\t/* handlerfn this handlers %s */\n"
"\tduk_dup(ctx, -4);\n"
"\t/* handlerfn this handlers %s handlerfn */\n"
"\tduk_put_prop(ctx, -3);\n"
"\t/* handlerfn this handlers */\n"
"\tdukky_register_event_listener_for(ctx, et,\n"
"\t\tcorestring_dom_%s, false);\n"
"\treturn 0;\n",
atributee->name + 2,
strlen(atributee->name + 2),
atributee->name + 2,
atributee->name + 2,
atributee->name + 2);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment