Summary: | Web Inspector: SyntaxError evaluating "1+1; //@ sourceURL=test" in console | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||||
Component: | Web Inspector (Deprecated) | Assignee: | Joseph Pecoraro <joepeck> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, graouts, joepeck, timothy, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | All | ||||||||
OS: | All | ||||||||
Attachments: |
|
Description
Joseph Pecoraro
2013-05-16 23:02:54 PDT
Test Before: // test SyntaxError: Expected token '}' Test After: // test undefined I think it is cleaner to have a newline before and after the expression. Especially if you add a sourceURL or debugger statement. That does mean exceptions / errors might be off by 1 in their stack trace. But we should do a better job there anyways. Created attachment 202048 [details]
[PATCH] Proposed Fix
Comment on attachment 202048 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=202048&action=review > Source/WebCore/inspector/InjectedScriptSource.js:600 > + expression = "with ((window && window.console && window.console.__commandLineAPI) || {}) {\n" + expression + "\n}"; I didn't put the newlines back originally so the line numbers for the evaluated expression would not change by adding the with() {}. Can you just add the suffix newline and keep the prefix newline off? Created attachment 202120 [details]
[PATCH] Updated Patch
(In reply to comment #2) > I think it is cleaner to have a newline before and after the expression. Especially if you add a sourceURL or debugger statement. That does mean exceptions / errors might be off by 1 in their stack trace. But we should do a better job there anyways. Timothy Hatcher's review comment made me drop the prefix newline. New patch up. Comment on attachment 202120 [details] [PATCH] Updated Patch Clearing flags on attachment: 202120 Committed r150280: <http://trac.webkit.org/changeset/150280> All reviewed patches have been landed. Closing bug. |