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

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

Issue 22650008: Add 'error' property to exceptions thrown via Worker::importScripts. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 7 years, 4 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/v8/V8ErrorHandler.h ('k') | Source/bindings/v8/V8Initializer.cpp » ('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 8f8b7c2cde57cac8645d7405a760ad79c659b0d8..f7b9681e8d62b30b87a1e8fa67fa24f12f5c253c 100644
--- a/Source/bindings/v8/V8ErrorHandler.cpp
+++ b/Source/bindings/v8/V8ErrorHandler.cpp
@@ -31,12 +31,16 @@
#include "config.h"
#include "bindings/v8/V8ErrorHandler.h"
+#include "V8ErrorEvent.h"
#include "bindings/v8/ScriptController.h"
#include "bindings/v8/V8Binding.h"
#include "bindings/v8/V8HiddenPropertyName.h"
#include "bindings/v8/V8ScriptRunner.h"
+#include "core/dom/Document.h"
#include "core/dom/ErrorEvent.h"
#include "core/dom/EventNames.h"
+#include "core/dom/ScriptExecutionContext.h"
+#include "core/page/Frame.h"
namespace WebCore {
@@ -73,6 +77,16 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptExecutionContext
return returnValue;
}
+// static
+void V8ErrorHandler::storeExceptionOnErrorEventWrapper(ErrorEvent* event, v8::Handle<v8::Value> data, v8::Isolate* isolate)
+{
+ v8::Local<v8::Value> wrappedEvent = toV8(event, v8::Handle<v8::Object>(), isolate);
+ if (!wrappedEvent.IsEmpty()) {
+ ASSERT(wrappedEvent->IsObject());
+ v8::Local<v8::Object>::Cast(wrappedEvent)->SetHiddenValue(V8HiddenPropertyName::error(), data);
+ }
+}
+
bool V8ErrorHandler::shouldPreventDefault(v8::Local<v8::Value> returnValue)
{
return returnValue->IsBoolean() && returnValue->BooleanValue();
« no previous file with comments | « Source/bindings/v8/V8ErrorHandler.h ('k') | Source/bindings/v8/V8Initializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698