Subj : Re: SpiderMonkey: JS_InitStandardClasses allways fails To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Tue May 06 2003 08:06 am Brendan Eich wrote: > Yes, indeed. But as Georg didn't show his global_class hooks, we can > only guess at what's going wrong. > > It is essential to provide full code, if it's not too voluminous, if one > wants help finding bugs by inspection. > > /be > Here it is. For my first steps I made the same as in js.c is done. JSBool stub_global_enumerate ( JSContext *cx , JSObject *obj ) { #ifdef LAZY_STANDARD_CLASSES return JS_EnumerateStandardClasses(cx, obj); #else return JS_TRUE; #endif } JSBool stub_global_resolve ( JSContext *cx , JSObject *obj , jsval id , uintN flags , JSObject **objp ) { #ifdef LAZY_STANDARD_CLASSES if ((flags & JSRESOLVE_ASSIGNING) == 0) { JSBool resolved; if(!JS_ResolveStandardClass(cx, obj, id, &resolved)) return JS_FALSE; if(resolved) { *objp = obj; return JS_TRUE; } } return JS_FALSE; #else return JS_TRUE; #endif } JSClass global_class = { "global" // sogenannter Klassen-Name , JSCLASS_NEW_RESOLVE // , JS_PropertyStub // add Property , JS_PropertyStub // delete Property , JS_PropertyStub // get Property , JS_PropertyStub // set Property , stub_global_enumerate // enumerate , (JSResolveOp) stub_global_resolve // resolve , JS_ConvertStub // convert , JS_FinalizeStub // finalize }; -- Georg Maaß - bioshop.de D-93466 Chamerau, Roßbergweg 42 JavaScript, C++ Engineering - The ultimative DHTML engine: http://gml-modul.sourceforge.net - http://sourceforge.net/projects/gml-modul .