Subj : Re: C embedding question: failure in JS_DefineFunction To : "Pavel Podgoretsky >" <"Pavel Podgoretsky >"> From : Brendan Eich Date : Mon Mar 17 2003 03:44 pm Pavel Podgoretsky wrote: >Greetings, > >I am trying to create a wrapper around a C function via > JS_DefineFunction( ctx, myobj, "Open", &native_fn, 0, 0 ) >where myobj was previously created with > JS_NewObject( ctx, &s_jsclass, 0, 0 ) > >I had this or very very similar code basically working a couple of years ago >[I think this statement is weak enough to be accurate :) ], but now I get an >error. Basically it seems to come from the following code in jsobj.c, >function GetClassPrototype( ): > if (!FindConstructor(cx, scope, name, &v)) > return JS_FALSE; > What error? Do you mean the program crashes, or is there an unexpected failure of FindConstructor? If the latter, what error is reported, or exception thrown? Use JS_SetErrorReporter to configure an error-reporter function. /be .