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
Родитель 46f780a5db
Коммит a41b3ec13e
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -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) {