Subj : Re: error handling in SpiderMonkey To : netscape.public.mozilla.jseng From : frankin@miramar.com (Forest Rankin) Date : Mon Aug 11 2003 11:20 am I believe you answered this by saying the parser doesn't have error recovery, but I just wanted to clarify. I would like to be able to report all/most errors in the script at compile-time and runtime. In the mozilla browser you can open the JavaScript console which will display all the errors and warnings on the current page. I would like to do something like this but I can only get the JS engine to report one error. Does Firebird use Rhino and that's why it can report multiple errors? See the "error handling in Rhino" post from "Date: 2002-01-16 16:38:10 PST" """ Try installing your own custom ErrorHandler using Context.setErrorHandler, then calling Context.compileReader, passing a null for the scope. This is what the jsc tool does; you can see it reports two errors on the source file. [rhino] cat test.js function x() { return debugger; } function foo bar() { } [rhino] java -classpath build/rhino1_5R3/js.jar org.mozilla.javascript.tools.jsc.Main test.js js: "test.js", line 2: identifier is a reserved word js: return debugger; js: ..................^ js: "test.js", line 5: missing ( before function parameters js: function foo bar() { js: ...............^ """ -forest Brendan Eich wrote in message news:<3F349E18.1030101@meer.net>... > Forest Rankin wrote: > > >How do I get the SpiderMonkey engine go through a > >Javascript script from start to end and report ALL syntax errors it > >can find, rather than just stopping on the first syntax error and kicking > >out? > > > > You'd have to add error recovery to the parser. That's something I > wanted to do originally, but it never became important enough in > web-browser embeddings. > > >I would also like to be able to log runtime errors and continue like > >the browser does. > > > > > > What do you mean by continue? An error that is not caught as an > exception stops the errant script or function in its tracks. > > /be .