Subj : Re: Getting function name with generic function call hook To : Sterling Bates From : Brendan Eich Date : Mon Oct 27 2003 07:05 pm Sterling Bates wrote: >No progress on JS_GetFunctionId -- it still requires a non-null JSFunction*, >and I'm working my way around the null problem. > > funobj := PJSObject(argv^ and (not JSVAL_TAGMASK)); > > Since JSVAL_OBJECT is 0, you could cheat and just use argv^ here -- try that, in case there's something wrong with and or not. > fun := PJSFunction(JS_GetPrivate(cx,funobj)); > > Can you verify via toString that funobj is a function object, in particular the one you expect? >I'm guessing from jsapi.h that JSVAL_TAGMASK equals $1 and $2 and $4 (since >JSVAL_TAGBITS is 3). > > ($1 or $2 or $4), aka $7, yeah. >If that's correct, still no dice. Is there a certain spidermonkey roadmap I >should follow to debug? Keep in mind I can't precisely follow the C code >from Delphi, but I can trace through the CPU and get a rough idea of what's >happening. > > I was assuming you knew C enough to follow the engine code -- sorry if not, and it's amazing you've put this bridge together! /be .