diff options
author | Vincent Sanders <vince@kyllikki.org> | 2015-08-05 22:58:05 +0100 |
---|---|---|
committer | Vincent Sanders <vince@kyllikki.org> | 2015-08-05 22:58:05 +0100 |
commit | dca5aa6db8f0dbcae283aee21605d8d1a85d7f94 (patch) | |
tree | 9c885d3bcedde0fbe557c63d61a385a0097a64d0 /src/duk-libdom.c | |
parent | 619dbd53bc4624e3a4e9bb291e61ed358272d009 (diff) | |
download | nsgenbind-dca5aa6db8f0dbcae283aee21605d8d1a85d7f94.tar.gz nsgenbind-dca5aa6db8f0dbcae283aee21605d8d1a85d7f94.tar.bz2 |
Add ptototype method type to binding
This allows additional cdata to be added to the generated prototype
constructor.
Diffstat (limited to 'src/duk-libdom.c')
-rw-r--r-- | src/duk-libdom.c | 15 |
1 files changed, 13 insertions, 2 deletions
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, |