Subj : Re: Calling non-existent object function crashes engine To : sydlogan From : Brendan Eich Date : Mon Sep 05 2005 03:52 pm Syd Logan wrote: > JSClass objectClass = { > name.c_str(), JSCLASS_NEW_RESOLVE, > JS_PropertyStub, JS_PropertyStub, > JS_PropertyStub, JS_PropertyStub, > JS_EnumerateStub, JS_ResolveStub, > JS_ConvertStub, JS_FinalizeStub > }; > > m_jsObj = JS_DefineObject(ctx, obj, name.c_str(), > &objectClass, NULL, 0); Hey Syd, Simplest theory first: if this is how the actual code looks, including objectClass being local to the calling function or method, then that won't work. The JSClass must live as long as any instance of it, and typically the way this is done is by making the JSClass struct static. /be .