Subj : Re: PAC support in SpiderMonkey To : netscape.public.mozilla.jseng From : Heath Raftery Date : Wed Aug 20 2003 11:41 pm In article <3F430B55.8090708@meer.net>, Brendan Eich wrote: > Heath Raftery wrote: > > >>The core language, specified by ECMA-262 Edition 3, is a general-purpose > >>scripting language. It has nothing about PAC, DOM, VXML, or any of the > >>many other embedding layers in it. > >> > >> > > > >I see, but didn't Netscape/Mozilla? develop PAC? > > > > Yes, Ari Luotonen and I did in 1995. See > http://lxr.mozilla.org/classic/source/network/main/mkautocf.c for what > was open-sourced on 3/31/1998 based on that original code. Ah, now this file has a good example of exactly where I get stuck - I now have code for each of the PAC extension functions, but a few of them require a dns resolve. AFAIK, Javascript cannot do that by itself. On line 1407, the Javascript function proxy_dns_resolve (which is used by each of the dns requiring pac utils), calls PR_GetHostByName. As far as I can tell, PR_GetHostByName is defined here http://lxr.mozilla.org/classic/source/nsprpub/pr/src/misc/prnetdb.c#272 which is clearly C code! Now, I understand this is more Javascript territory than jeng, but I asked in comp.lang.javascript about calling C code in Javascript or otherwise implementing a dns lookup, and was met with silence. > > I would have thought > >there would be code available to support PAC files, since it seems a > >little silly to require everyone who wants to support PAC to roll their > >own. > > > > Indeed, but not every embedding that wants PAC support wants the netlib > we released in '98, or today's Mozilla Necko netlib. If you want the > latter, though, the PAC implementation is there. Absolutely! Maybe it is my lack of Javascript knowledge which is holding me back then. To that end, I'd most appreciate some feedback on my q's above! Thanks a million for your help, I'll certainly post a followup of any progress. -- Heath ________________________________________________________ | *Nothing is foolproof to a sufficiently talented fool* | | _\|/_ | |________________________________________m(. .)m_________| .