On Dec 4, 9:26 am, Thomas Kappler <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm extending a Java class via the -extends argument to the debugger.

Did you mean compiler instead of debugger?

> So far, I declare my JS function simply via
>
> function myFunc() {
>   // do something
>
> }
>
> The Rhino compiler turns this into a method returning
> java.lang.Object, as seen via javap.
>
> Is there a way to let the compiled method be of type void?
>
> Thanks,
> Thomas

You could define an interface

interface Foo {
  public void myFunc();
}

and then compile the JavaScript with -implements Foo. I haven't tried
it, but I think it will force Rhino to match the void return type in
the interface.

--N
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to