On Sep 5, 2:21 am, Owen Taylor <[EMAIL PROTECTED]> wrote:
> with a single Object[] argument? It's not crazy behavior, but it's a
> little magic, and maybe not compatible enough. The second thought was
> that varargs methods are actually flagged in the bytecode. So, if we
> modified Invokable a bit to have:
>
> interface Invokable {
> Object invoke(Object args...);
> }
>
> And Rhino automatically turned Java varargs into the Javascript
> concept of calling with varargs (the argument list is just a list of
> arguments), then everything would work out perfectly.
>
> widget.connect("MouseDown", function(event) {
> print(event.x, event.y);
> });
>
> Only disadvantages I see: there might be a few programs out there
> depending on the current behavior, and maybe it's a little weird to
> make the mapping depend on something that is not, strictly speaking,
> part of the method signature.
In more investigation, Rhino actually already pays attention to the
varargs flag in the bytecode when calling Java methods, so doing the
same when going the other way makes a lot of sense to me. I went ahead
an implemented it:
https://bugzilla.mozilla.org/show_bug.cgi?id=453997
- Owen
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino