From dca5aa6db8f0dbcae283aee21605d8d1a85d7f94 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Wed, 5 Aug 2015 22:58:05 +0100 Subject: Add ptototype method type to binding This allows additional cdata to be added to the generated prototype constructor. --- src/duk-libdom.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/duk-libdom.c') diff --git a/src/duk-libdom.c b/src/duk-libdom.c index 31ec0a1..b01ac4e 100644 --- a/src/duk-libdom.c +++ b/src/duk-libdom.c @@ -870,12 +870,23 @@ output_interface_prototype(FILE* outf, struct interface_map_entry *interfacee, struct interface_map_entry *inherite) { + struct genbind_node *proto_node; + + /* find the prototype method on the class */ + proto_node = genbind_node_find_method(interfacee->class, + NULL, + 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)\n", DLPFX, interfacee->class_name); fprintf(outf,"{\n"); + /* Output any binding data first */ + if (output_cdata(outf, proto_node, GENBIND_NODE_TYPE_CDATA) != 0) { + fprintf(outf,"\n"); + } + /* generate prototype chaining if interface has a parent */ if (inherite != NULL) { fprintf(outf, -- cgit v1.2.3