Subj : Re: API.File method execution problem using spidermonkey To : Brendan Eich From : Rob Swindell Date : Thu Feb 03 2005 12:41 pm Re: Re: API.File method execution problem using spidermonkey By: Brendan Eich to Matthew Mondor on Tue Feb 01 2005 02:10 pm > Matthew Mondor wrote: > > > The API.File constructor can be used properly to create a new File > > object, and the new objects properties are working fine. However, the > > object's methods refuse to work (currently a simple test() method > > requireing no arguments). Whenever an attempt is made to call that > > method, the script execution is immediately interrupted, without an > > exception being catchable by the script. > > > That means your code is returning false somewhere without first > reporting an error or setting a pending exception. > > > > 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 have a rather robust and well-tested SpiderMonkey File class I developed for Synchronet (www.synchro.net). It has lot of features that you probably wouldn't want (base64/uue/yenc encode/decode, .ini file parsing, etc.), but the fundamental file I/O operations are very sound. I'd be willing to submit a suitably stripped down version as a replacement for your jsfile.c, if you wish it. The source can be see here: http://cvs.synchro.net/cgi-bin/viewcvs.cgi/src/sbbs3/js_file.c And the class is documented here: http://synchro.net/docs/jsobjs.html#File The basic property/method names were based on the class from jsfile.c, so it's at least somewhat compatible. Let me know if there's any interest, digital man Snapple "Real Fact" #48: Cats can hear ultrasound. .