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

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

Issue 20351002: Add 'error' parameter to 'window.onerror' handlers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Constructor. Created 7 years, 5 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/bindings/scripts/deprecated_code_generator_v8.pm ('k') | Source/bindings/v8/V8HiddenPropertyName.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8ErrorHandler.cpp
diff --git a/Source/bindings/v8/V8ErrorHandler.cpp b/Source/bindings/v8/V8ErrorHandler.cpp
index 397c6a35203a974d2d944f8392a5f63e45922932..8f8b7c2cde57cac8645d7405a760ad79c659b0d8 100644
--- a/Source/bindings/v8/V8ErrorHandler.cpp
+++ b/Source/bindings/v8/V8ErrorHandler.cpp
@@ -33,6 +33,7 @@
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/V8Binding.h"
+#include "bindings/v8/V8HiddenPropertyName.h"
#include "bindings/v8/V8ScriptRunner.h"
#include "core/dom/ErrorEvent.h"
#include "core/dom/EventNames.h"
@@ -56,7 +57,12 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptExecutionContext
if (!listener.IsEmpty() && listener->IsFunction()) {
v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
v8::Local<v8::Object> thisValue = v8::Context::GetCurrent()->Global();
- v8::Handle<v8::Value> parameters[4] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate) };
+
+ v8::Local<v8::Value> error = jsEvent->ToObject()->GetHiddenValue(V8HiddenPropertyName::error());
+ if (error.IsEmpty())
+ error = v8::Null(isolate);
+
+ v8::Handle<v8::Value> parameters[5] = { v8String(errorEvent->message(), isolate), v8String(errorEvent->filename(), isolate), v8::Integer::New(errorEvent->lineno(), isolate), v8::Integer::New(errorEvent->colno(), isolate), error };
v8::TryCatch tryCatch;
tryCatch.SetVerbose(true);
if (worldType(isolate) == WorkerWorld)
« no previous file with comments | « Source/bindings/scripts/deprecated_code_generator_v8.pm ('k') | Source/bindings/v8/V8HiddenPropertyName.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698