Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: Source/WebCore/dom/ScriptExecutionContext.cpp

Issue 6409009: Merge 76429 - 2011-01-21 Yury Semikhatsky <yurys@chromium.org>... (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/bindings/v8/ScriptSourceCode.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/ScriptExecutionContext.cpp
===================================================================
--- Source/WebCore/dom/ScriptExecutionContext.cpp (revision 77121)
+++ Source/WebCore/dom/ScriptExecutionContext.cpp (working copy)
@@ -294,9 +294,23 @@
if (!target)
return false;
+ String message;
+ int line;
+ String sourceName;
+ KURL targetUrl = completeURL(sourceURL);
+ if (securityOrigin()->canRequest(targetUrl)) {
+ message = errorMessage;
+ line = lineNumber;
+ sourceName = sourceURL;
+ } else {
+ message = "Script error.";
+ sourceName = String();
+ line = 0;
+ }
+
ASSERT(!m_inDispatchErrorEvent);
m_inDispatchErrorEvent = true;
- RefPtr<ErrorEvent> errorEvent = ErrorEvent::create(errorMessage, sourceURL, lineNumber);
+ RefPtr<ErrorEvent> errorEvent = ErrorEvent::create(message, sourceName, line);
target->dispatchEvent(errorEvent);
m_inDispatchErrorEvent = false;
return errorEvent->defaultPrevented();
« no previous file with comments | « Source/WebCore/bindings/v8/ScriptSourceCode.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698