Use lazy loading constructors where possible for extension constructors

This commit is contained in:
hns 2004-05-19 13:55:51 +00:00
parent ae38654a7a
commit 0a030f932a

View file

@ -99,10 +99,16 @@ public final class RhinoCore {
pathProto = new PathWrapper(this);
hopObjectProto = HopObject.init(global);
FileObject.init(global);
FtpObject.init(global);
ImageObject.init(global);
XmlRpcObject.init(global);
// use lazy loaded constructors for all extension objects that
// adhere to the ScriptableObject.defineClass() protocol
new LazilyLoadedCtor(global, "File",
"helma.scripting.rhino.extensions.FileObject", false);
new LazilyLoadedCtor(global, "Ftp",
"helma.scripting.rhino.extensions.FtpObject", false);
new LazilyLoadedCtor(global, "Image",
"helma.scripting.rhino.extensions.ImageObject", false);
new LazilyLoadedCtor(global, "Remote",
"helma.scripting.rhino.extensions.XmlRpcObject", false);
MailObject.init(global, app.getProperties());
// add some convenience functions to string, date and number prototypes