Gitweb links:
...log
http://git.netsurf-browser.org/nsgenjsbind.git/shortlog/e35c777cc2d3d551d...
...commit
http://git.netsurf-browser.org/nsgenjsbind.git/commit/e35c777cc2d3d551d4f...
...tree
http://git.netsurf-browser.org/nsgenjsbind.git/tree/e35c777cc2d3d551d4f65...
The branch, master has been updated
via e35c777cc2d3d551d4f659e95c06b902379992aa (commit)
from 65e49e23019a97d51702077c82613c6c26e84033 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/nsgenjsbind.git/commitdiff/e35c777cc2d3d55...
commit e35c777cc2d3d551d4f659e95c06b902379992aa
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
make the argv generation conditional on its use
diff --git a/src/jsapi-libdom-operator.c b/src/jsapi-libdom-operator.c
index 4edf235..748ea4c 100644
--- a/src/jsapi-libdom-operator.c
+++ b/src/jsapi-libdom-operator.c
@@ -162,6 +162,13 @@ output_variable_definitions(struct binding *binding,
arg_node = webidl_node_find_type(arglist,
arg_node,
WEBIDL_NODE_TYPE_ARGUMENT);
+
+ /* at least one argument or private need to generate argv variable */
+ if ((arg_node != NULL) || binding->has_private) {
+ fprintf(binding->outfile,
+ "\tjsval *argv = JSAPI_ARGV(cx, vp);\n");
+ }
+
while (arg_node != NULL) {
/* generate variable to hold the argument */
arg_ident = webidl_node_find_type(webidl_node_getnode(arg_node),
@@ -441,9 +448,6 @@ static int webidl_operator_body_cb(struct webidl_node *node, void
*ctx)
fprintf(binding->outfile,
"{\n");
- fprintf(binding->outfile,
- "\tjsval *argv = JSAPI_ARGV(cx, vp);\n");
-
output_variable_definitions(binding, webidl_node_getnode(node));
if (binding->has_private) {
-----------------------------------------------------------------------
Summary of changes:
src/jsapi-libdom-operator.c | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/jsapi-libdom-operator.c b/src/jsapi-libdom-operator.c
index 4edf235..748ea4c 100644
--- a/src/jsapi-libdom-operator.c
+++ b/src/jsapi-libdom-operator.c
@@ -162,6 +162,13 @@ output_variable_definitions(struct binding *binding,
arg_node = webidl_node_find_type(arglist,
arg_node,
WEBIDL_NODE_TYPE_ARGUMENT);
+
+ /* at least one argument or private need to generate argv variable */
+ if ((arg_node != NULL) || binding->has_private) {
+ fprintf(binding->outfile,
+ "\tjsval *argv = JSAPI_ARGV(cx, vp);\n");
+ }
+
while (arg_node != NULL) {
/* generate variable to hold the argument */
arg_ident = webidl_node_find_type(webidl_node_getnode(arg_node),
@@ -441,9 +448,6 @@ static int webidl_operator_body_cb(struct webidl_node *node, void
*ctx)
fprintf(binding->outfile,
"{\n");
- fprintf(binding->outfile,
- "\tjsval *argv = JSAPI_ARGV(cx, vp);\n");
-
output_variable_definitions(binding, webidl_node_getnode(node));
if (binding->has_private) {
--
NetSurf Generator for JavaScript bindings