Ignore any exception during script class initialization unless it is an instance of RhinoException. In this way lazily class loading or incompatible with the current JVMs jars will simply hide the script variables.

This commit is contained in:
igor%mir2.org 2004-07-28 15:20:08 +00:00
parent 9af31a7101
commit 8799f9f62b

View File

@ -83,10 +83,14 @@ public final class LazilyLoadedCtor {
try {
ScriptableObject.defineClass(obj, cl, sealed);
isReplaced = true;
} catch (RhinoException e) {
throw e;
} catch (SecurityException ex) {
removeOnError = true;
} catch (Exception e) {
throw Context.throwAsScriptRuntimeEx(e);
} catch (Throwable ex) {
// Ignore any other erors. Due to lazily class loading
// it may indicate absence of some necessary classes.
removeOnError = true;
}
}
if (removeOnError) {