This seems fragile to me.

In your place, I'd rather somehow build interception around the host object. I.e. declare an interface for the host objects, and for purposes of testing wrap it in a java.lang.reflect.Proxy that reports exceptions into a log. Or use some AOP solution for achieving essentialy the same functionality.

Attila.

--
home: http://www.szegedi.org
twitter: http://twitter.com/szegedi
weblog: http://constc.blogspot.com

On 2008.12.10., at 11:38, Marc Guillemot wrote:

Hi,

when for instance a NullPointerException occurs in method foo of my host
object in a JS code like this one

try
{
 ...
 myHostObject.foo()
 ...
}
catch (e)
{
 // do something
}

the try/catch block will catch it and I won't see that there is a
problem in the Java code of my host object.

It seems to me that it would make sense if users could have the
possibility to configure Rhino to have "Java exceptions" catch in
try/catch block or not. In our case (HtmlUnit) this would allow us to
faster find errors in our host objects.

What do you think?

Cheers,
Marc.
--
Web: http://www.efficient-webtesting.com
Blog: http://mguillem.wordpress.com
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to