Bug 25630
Summary: | JavaScript console doesn't provide useful error messages for syntax errors | ||
---|---|---|---|
Product: | WebKit | Reporter: | boucher <rboucher> |
Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | barraclough, podivilov, yurys |
Priority: | P2 | Keywords: | InRadar |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
boucher
Steps to reproduce:
1. Load any page with invalid JavaScript code.
2. Open the Web Inspector
3. You should see the error string "SyntaxError: Parse error"
This error string is not useful, and provides no context about either the location of the parse error, or the kind of error. Try loading the same file in Firefox with Firebug and you'll get a very descriptive error, like the following:
missing ; before statement
"some code from the line following the error would be shown here";
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Mark Rowe (bdash)
The error message is rather generic, but there *is* context about the location of the error. As with other exceptions logged in the console, the file name and line number are given to the right of the exception message and can be clicked to reveal the relevant part of the source.
Mark Rowe (bdash)
<rdar://problem/6867110>
boucher
Fair point. I didn't notice because the line number info isn't useful with eval'd code (it gives the location of the eval, rather than the location of the line within the eval, which is why the firebug error was more relevant, since it gives you the following line of code)
Mark Rowe (bdash)
Ok, so it seems like there are two separate issues to address:
1) Giving more specific errors than "parse error"
2) Providing a link to context in eval'd source
We should use this bug to track the former as it's a JavaScriptCore issue, and file a new bug about the second which is likely to primarily be a web inspector issue.
Gavin Barraclough
*** This bug has been marked as a duplicate of bug 62613 ***