Subj : Re: server-side compilation using spidermonkey To : wyl_lyf From : Brendan Eich Date : Thu Jan 06 2005 03:53 pm wyl_lyf@yahoo.com wrote: > Hello! Thanks for the patience. I tried the program. But I don't think > it detects any syntax errors because if I placed in an unknown object > name. it still says okay.?? What are you talking about, exactly? Please give a complete example. > I checked the usage of the API > JS_BufferIsCompilableUnit but I can't see it on spidermonkey? If you mean in the API docs, it may have been added (by mccabe, if memory serves) after the API docs were (poorly) written by a tech writer at Netscape, years ago, and no one ever updated the docs. Read the source, use the force. > can this process this input file: > Response.Write ("\n"); > Response.Write ("\n"); > Response.Write ("Customer\n"); > Response.Write (" content=text/html;charset=iso-8859-1>\n > "); > Response.Write ("\n"); > Response.Write ("\n"); > Response.Write (" \n"); > mytest.example(); > Response.Write (" \n"); > Response.Write ("\n"); > Response.Write ("\n"); This looks like valid JS to me. If you want something that can detect an unknown object name (Response? Response.Write? I have no idea what you define and do not define), you are looking for more than *syntax* checking, as I predicted two messages ago (news://news.mozilla.org:119/41DD840B.8000904@meer.net). Name binding is not a matter of syntax, but of semantics -- you can't write a JS grammar that accepts only programs with bound names, in general. Please pick your problem and state it carefully when asking for help! /be .