Subj : Re: Creating classes/namespaces on the fly from existing functions? To : netscape.public.mozilla.jseng From : bubbfree Date : Thu Jan 06 2005 08:31 pm Oh wait... maybe it's simpler than that. .. how about: JSObject* pExternalObj = JS_NewObject(.... ...); JS_EvaluateFile(cx, pExternalObj, .....); JS_DefineObject(cx, myMainGlobalObj, "external1", , pExternalObj, JSPROP_PERMANENT); would my pExternalObj just serve as the prototype object for the new "external1" in my global scope ? And the JSClassDef that I put in can just be a generic one w/o much defined in there ? Would this work? .