[Jslib] Bug in RemoteFile?

Pete Collins pete at mozdev.org
Sat Nov 29 08:38:38 EST 2003

Sean C. Nichols wrote:
> Hi!
> I hope this hasn't already been dealt with; I scanned over the newsgroup 
> archives, but didn't see anything. Nor can I see anything in BugZilla.
> Anyway, I just downloaded the development build of JSLib (for Mozilla) 
> as of Nov.25th, i.e.: the latest I can find.
> I'm using it writing some code that interacts with TagZilla... and 
> wanted to add some http file functionality. It looked like 
> network/remoteFile was the way to go, but when I tried include()ing the 
> file, the function (include()) returned an error.
> I traced the problem to the fact that network/remoteFile.js defines 
> JS_FILE_IOSERVICE_CID, JS_FILE_I_IOSERVICE, and a number of other 
> JS_FILE_* constants, which conflicted with the same constants in 
> io/file.js (which I also had include()d).
> Changing those constants to JS_REMOTEFILE_* (as would make sense to me) 
> -- as well as any reference to them within remoteFile.js -- seems to 
> have fixed it, and things are now working as I expect.
> However:
> Was this an oversight in JSLib? Is this the intended operation? Is 
> remoteFile.js broken? Am I broken (or trying to do things in a broken 
> way)? Will this  "fix" potentially cause me other headaches? Should I 
> check my fix into CVS (it consists solely of those renamings in that one 
> file)?

Yes, this actually raises an issue I haven't obviously tested thoroughly 
enough for, constant/namespace collision among libs.

RemoteFile is very functional and works peachy.

I'll post a patch to the bug now.

> Thanks in advance for any advice!
>    - Sean

Pete Collins

More information about the Jslib mailing list