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

Unified Diff: Source/bindings/v8/V8ErrorHandler.cpp

Issue 21071003: Trigger `window.onerror` only for exceptions thrown in the same world. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: feedback Created 7 years, 3 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: Source/bindings/v8/V8ErrorHandler.cpp
diff --git a/Source/bindings/v8/V8ErrorHandler.cpp b/Source/bindings/v8/V8ErrorHandler.cpp
index f7b9681e8d62b30b87a1e8fa67fa24f12f5c253c..3422241b68f1f48a2a7faa0b80a98047c05b8b29 100644
--- a/Source/bindings/v8/V8ErrorHandler.cpp
+++ b/Source/bindings/v8/V8ErrorHandler.cpp
@@ -55,8 +55,12 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptExecutionContext
return V8EventListener::callListenerFunction(context, jsEvent, event);
ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
- v8::Local<v8::Object> listener = getListenerObject(context);
+
v8::Isolate* isolate = toV8Context(context, world())->GetIsolate();
+ if (errorEvent->world() && errorEvent->world() != world())
+ return v8::Null(isolate);
+
+ v8::Local<v8::Object> listener = getListenerObject(context);
v8::Local<v8::Value> returnValue;
if (!listener.IsEmpty() && listener->IsFunction()) {
v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
« no previous file with comments | « LayoutTests/fast/events/window-onerror-isolatedworld-02-expected.txt ('k') | Source/bindings/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698