Subj : Re: API.File method execution problem using spidermonkey To : netscape.public.mozilla.jseng From : Matthew Mondor Date : Fri Feb 04 2005 05:26 pm On Tue, 01 Feb 2005 14:10:28 -0800 Brendan Eich wrote: > > I used jsfile.c as an example a bit to try to see what could be > > wrong, > > > Don't use jsfile.c as an example of anything. We're contemplating cvs > > removing it. It's not well-written from a number of angles. You may > have copied a bug from it, at least a bug that bites your mutation of > its code. I didn't use it as a base for any of my code, but basically looked at it to verify if I was missing anything in my js_FileInitClass() function... The problem indeed was that my custom getProperty() method returned JS_FALSE if the id wasn't within expected bounds (I had rolled up my own id->function index for properties and had bound checking against the enum range), I wasn't expecting at firstthat getProperty() would get called to also resolve method/function names. So this was indeed fixed when I tracked which of my code returned JS_FALSE, as you suspected :) Thanks It seems that there already is provision for tinyid indexes using enumeration flag or such, I probably should try to use this instead to map properties to their appropriate property get/set functions efficiently without rolling my own like I previously did. Of course, to fix my problem I just had to return JS_TRUE instead of JS_FALSE if the id wasn't within the expected enumeration range... But there probably is no point in rolling my own index mapping if support is already provided for this. Matt .