User-Agent: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Build Identifier: Mozilla/5.0 (X11; Linux i686; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Given these this three-line program: var a = 3; var s = /abc:(*?)def/; var c = 4; the js shell just reports "invalid quantifier" instead of following the form of other error messages, as given in the Expected Results field. Reproducible: Always Steps to Reproduce: Build Mozilla with the js shell. Create the file with the above three lines. Run the command [path to js]/js foo.js Actual Results: invalid quantifier Expected Results: I would expect output like so: foo.js:2: SyntaxError: invalid quantifier: foo.js:2: var s = /abc:(*?)def/; foo.js:2: ..............^ Although that third line is somewhat hopeful on my part. But instead I'm not getting any line number.
This behavior is present even before the recent Yarr landing. It seems to relate to some detail of Spidermonkey error reporting.
(In reply to comment #1) > This behavior is present even before the recent Yarr landing. It seems to > relate to some detail of Spidermonkey error reporting. It did regress on the first Yarr landing, though. So that should help in tracking it down.
Created attachment 542356 [details] [diff] [review] Patch to enable syntax error reporting There are actually 2 separate regressions from the pre-Yarr behavior here: 1. Syntax errors in regexp literals aren't getting reported as syntax errors, but just get a raw error string instead. 2. We used to show the point of the error within the regexp text, but now we don't. #1 is the more serious one, and easier to fix: the patch is for that. #2 is less serious, and harder to fix: it would require teaching Yarr to report the point at which syntax errors occur. Should be possible, but it would be nice to coordinate with WebKit. So let's let this be a followup bug.
cdleary-bot mozilla-central merge info: http://hg.mozilla.org/mozilla-central/rev/38322c7498ff