зеркало из https://github.com/mozilla/gecko-dev.git
Make sure creation of class loader is inside a try block to handle security exceptions.
This commit is contained in:
Родитель
43edbee475
Коммит
52141616b0
|
@ -237,6 +237,8 @@ public class JavaAdapter extends ScriptableObject {
|
|||
Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
|
||||
return ss.defineClass(adapterName, bytes, securityDomain);
|
||||
} else {
|
||||
if (classLoader == null)
|
||||
classLoader = new MyClassLoader();
|
||||
classLoader.defineClass(adapterName, bytes);
|
||||
return classLoader.loadClass(adapterName, true);
|
||||
}
|
||||
|
@ -840,7 +842,7 @@ public class JavaAdapter extends ScriptableObject {
|
|||
}
|
||||
}
|
||||
|
||||
private static int serial = 0;
|
||||
private static MyClassLoader classLoader = new MyClassLoader();
|
||||
private static int serial;
|
||||
private static MyClassLoader classLoader;
|
||||
private static Hashtable generatedClasses = new Hashtable(7);
|
||||
}
|
||||
|
|
|
@ -237,6 +237,8 @@ public class JavaAdapter extends ScriptableObject {
|
|||
Object securityDomain = cx.getSecurityDomainForStackDepth(-1);
|
||||
return ss.defineClass(adapterName, bytes, securityDomain);
|
||||
} else {
|
||||
if (classLoader == null)
|
||||
classLoader = new MyClassLoader();
|
||||
classLoader.defineClass(adapterName, bytes);
|
||||
return classLoader.loadClass(adapterName, true);
|
||||
}
|
||||
|
@ -840,7 +842,7 @@ public class JavaAdapter extends ScriptableObject {
|
|||
}
|
||||
}
|
||||
|
||||
private static int serial = 0;
|
||||
private static MyClassLoader classLoader = new MyClassLoader();
|
||||
private static int serial;
|
||||
private static MyClassLoader classLoader;
|
||||
private static Hashtable generatedClasses = new Hashtable(7);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче