diff options
author | Momtchil Momtchev <momtchil@momtchev.com> | 2023-04-26 18:23:53 +0200 |
---|---|---|
committer | Momtchil Momtchev <momtchil@momtchev.com> | 2023-04-26 18:23:53 +0200 |
commit | edd55210bb2d4212aeae0876372dd99c867f0071 (patch) | |
tree | 8a80abd8556ae425becbf3bab14169a51db54cdc /Source | |
parent | 1657a0a1ec8dbdded01ab0a225bf290b44ef4a18 (diff) | |
download | swig-edd55210bb2d4212aeae0876372dd99c867f0071.tar.gz |
take into account numinputs when counting arguments
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Modules/javascript.cxx | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/Source/Modules/javascript.cxx b/Source/Modules/javascript.cxx index 2fbc5505c..a837f6275 100644 --- a/Source/Modules/javascript.cxx +++ b/Source/Modules/javascript.cxx @@ -264,8 +264,6 @@ protected: */ Node *getBaseClass(Node *n); - Parm *skipIgnoredArgs(Parm *p); - virtual int createNamespace(String *scope); virtual Hash *createNamespaceEntry(const char *name, const char *parent, const char *parent_mangled); @@ -689,17 +687,6 @@ int JSEmitter::initialize(Node * /*n */ ) { return SWIG_OK; } -/* --------------------------------------------------------------------- - * skipIgnoredArgs() - * --------------------------------------------------------------------- */ - -Parm *JSEmitter::skipIgnoredArgs(Parm *p) { - while (checkAttribute(p, "tmap:in:numinputs", "0")) { - p = Getattr(p, "tmap:in:next"); - } - return p; -} - /* ----------------------------------------------------------------------------- * JSEmitter::getBaseClass() : the node of the base class or NULL * @@ -2173,7 +2160,7 @@ void V8Emitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Mar Setattr(n, ARGCOUNT, argcount); int i = 0; - for (p = parms; p; i++) { + for (p = parms; p;) { String *arg = NewString(""); String *type = Getattr(p, "type"); @@ -2185,26 +2172,33 @@ void V8Emitter::marshalInputArgs(Node *n, ParmList *parms, Wrapper *wrapper, Mar case Getter: if (is_member && !is_static && i == 0) { Printv(arg, "info.Holder()", 0); + i++; } else { - Printf(arg, "args[%d]", i - startIdx); + Printf(arg, "args[%d]", i - startIdx); + i += GetInt(p, "tmap:in:numinputs"); } break; case Function: if (is_member && !is_static && i == 0) { Printv(arg, "args.Holder()", 0); + i++; } else { Printf(arg, "args[%d]", i - startIdx); + i += GetInt(p, "tmap:in:numinputs"); } break; case Setter: if (is_member && !is_static && i == 0) { Printv(arg, "info.Holder()", 0); + i++; } else { Printv(arg, "value", 0); + i++; } break; case Ctor: Printf(arg, "args[%d]", i); + i += GetInt(p, "tmap:in:numinputs"); break; default: Printf(stderr, "Illegal MarshallingMode."); |