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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp

Issue 2006893004: Store SourceLocation in ErrorEvent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2010603002
Patch Set: rebased Created 4 years, 7 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
Index: third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp
index 9a7c82293fcc9540ed1216742c0c05dc7c024b2b..5d8d58911e731ab3707344e0b367edb2b97b4e37 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8LazyEventListener.cpp
@@ -207,13 +207,7 @@ void V8LazyEventListener::prepareListenerObject(ExecutionContext* executionConte
void V8LazyEventListener::fireErrorEvent(v8::Local<v8::Context> v8Context, ExecutionContext* executionContext, v8::Local<v8::Message> message)
{
- String messageText = toCoreStringWithNullCheck(message->Get());
- int lineNumber = 0;
- int columnNumber = 0;
- if (v8Call(message->GetLineNumber(v8Context), lineNumber)
- && v8Call(message->GetStartColumn(v8Context), columnNumber))
- ++columnNumber;
- ErrorEvent* event = ErrorEvent::create(messageText, m_sourceURL, lineNumber, columnNumber, &world());
+ ErrorEvent* event = ErrorEvent::create(toCoreStringWithNullCheck(message->Get()), SourceLocation::fromMessage(isolate(), message, executionContext), &world());
AccessControlStatus accessControlStatus = NotSharableCrossOrigin;
if (message->IsOpaque())
@@ -221,7 +215,7 @@ void V8LazyEventListener::fireErrorEvent(v8::Local<v8::Context> v8Context, Execu
else if (message->IsSharedCrossOrigin())
accessControlStatus = SharableCrossOrigin;
- executionContext->reportException(event, SourceLocation::create(m_sourceURL, lineNumber, columnNumber, nullptr), accessControlStatus);
+ executionContext->reportException(event, accessControlStatus);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698