Looks like the "with() { <expr> }" evaluation path needs to allow a newline after the user provided expression. If it ends in a single line comment it would comment out the closing brace for the with block! This is a Regression for sure. Easy fix.
<rdar://problem/13920910>
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.
<rdar://problem/13921036>
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.