mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Fix for problem:
There is a bug in JavaScriptException which prevents it from being used with out a Rhino Context. When the getMessage() method is invoked on it, the exception goes to the ScriptRuntime to toString the value. If you have already exited your context, the runtime will throw an error. The solution is to simply remove the overridden getMessage method from JavaScriptException. JavaScriptException's constructor calls the Exception constructor with the toString'ed value. The default implementation of getMessage will return the exception message. Jeff
This commit is contained in:
parent
6642d0e4f2
commit
f70b7e4c78
@ -58,15 +58,6 @@ public class JavaScriptException extends Exception {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the exception message.
|
||||
*
|
||||
* <p>Will just convert the wrapped exception to a string.
|
||||
*/
|
||||
public String getMessage() {
|
||||
return ScriptRuntime.toString(value);
|
||||
}
|
||||
|
||||
static JavaScriptException wrapException(Scriptable scope,
|
||||
Throwable exn)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user