Subj : Re: SpiderMonkey: JS_InitStandardClasses allways fails To : Franky Braem From : Brendan Eich Date : Mon May 05 2003 02:14 pm Franky Braem wrote: >This is how I turn a jsval into a std::string > >JSString *s = JS_ValueToString(cx, v); >std::string str(JS_GetStringBytes(s), JS_GetStringLength(s)); > > This chops Unicode chars with code points >= 256 down to one byte, throwing away the upper byte. >You can do this also for types that you don't support. JS_ValueToString will >always try to convert the jsval into a String representation. > >Why do you use LAZY_STANDARD_CLASSES? I think you have to make a >JS_ResolveStub for the global class, so that when somebody uses a standard >class for the first time, the class gets initialized. > > 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 .