Subj : Re: [SpiderMonkey] JS_DefineObject returns null after moving to newest To : Brian Barnes From : Brendan Eich Date : Sat Jul 19 2003 06:15 pm Brian Barnes wrote: > On Saturday, July 19, 2003, at 12:16 PM, Brendan Eich wrote: > >> Can you do me a favor and show me the stack backtrace when >> scripts_resolve_object is called indirectly from your (doomed to >> fail, with the new version of the engine) call to JS_DefineProperty? > > > Sure Brendan. > > I didn't catch what was going on either because my resolve returned > JS_FALSE, to cancel the addition. That's a silent error, not a non-error cancel signal. > This was causing me problems elsewhere, so it was mysterious until I > tracked it down. Or, i.e., I didn't check for JS_DefineProperty to > return null :) Oops. > > Hopefully this is enough. I forced the scripts_resolve_object to > throw an error, so I could get the backtrace. > > Thread 0 Crashed: > #0 0x00044104 in scripts_resolve_object > #1 0x000440f8 in scripts_resolve_object > #2 0x00057e84 in FindConstructor I don't think the engine changed. Is it possible you changed something in the order of initialization? Are you using lazy JS_ResolveStandardClass now when you used eager JS_InitStandardClasses (before anything else was done on the global object) before? > > #3 0x000551a8 in GetClassPrototype > #4 0x000523a8 in js_NewObject > #5 0x00049568 in JS_DefineObject > #6 0x00044908 in js_add_event_object > #7 0x0004396c in scripts_add > #8 0x00006dec in game_start > #9 0x0000b764 in main > #10 0x00004088 in _start (crt.c:267) > #11 0x00003f08 in start I'm not sure how this could have ever worked, though -- if your global object was of a class that had scripts_reoslve_object as its resolve hook, and that hook always returned false, then you should have seen silent failures all along, from anything attempting to make a new object. Maybe scripts_resolve_object doesn't return false unconditionally, though. I'd have to see it to say more. /be > > > [>] Brian > > .