summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-28 13:10:33 +0100
committerBen Murdoch <benm@google.com>2009-08-28 13:10:33 +0100
commit377c793d7f2f00841bc549f4831059755004e4c4 (patch)
treeda95e7aaf5db4579979d59f4adfc1a92b002bd68 /WebCore/bindings
parent8e008b4b8cd6aff82cb9a9705e13a637285c705d (diff)
downloadexternal_webkit-377c793d7f2f00841bc549f4831059755004e4c4.zip
external_webkit-377c793d7f2f00841bc549f4831059755004e4c4.tar.gz
external_webkit-377c793d7f2f00841bc549f4831059755004e4c4.tar.bz2
Update V8 bindings to report exceptions thrown from callbacks.
Diffstat (limited to 'WebCore/bindings')
-rw-r--r--WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp b/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
index 925271f..b538b33 100644
--- a/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
+++ b/WebCore/bindings/v8/custom/V8CustomVoidCallback.cpp
@@ -29,6 +29,7 @@
*/
#include "config.h"
+#include "V8Binding.h"
#include "V8CustomVoidCallback.h"
#include "Frame.h"
@@ -66,7 +67,6 @@ void V8CustomVoidCallback::handleEvent()
bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8::Value> argv[], bool& callbackReturnValue)
{
- // FIXME: If an exception was thrown by the callback, we should report it
v8::TryCatch exceptionCatcher;
v8::Local<v8::Function> callbackFunction;
@@ -92,7 +92,13 @@ bool invokeCallback(v8::Persistent<v8::Object> callback, int argc, v8::Handle<v8
callbackReturnValue = !result.IsEmpty() && result->IsBoolean() && result->BooleanValue();
- return exceptionCatcher.HasCaught();
+ if (exceptionCatcher.HasCaught()) {
+ v8::Local<v8::Message> message = exceptionCatcher.Message();
+ proxy->frame()->document()->reportException(toWebCoreString(message->Get()), message->GetLineNumber(), toWebCoreString(message->GetScriptResourceName()));
+ return true;
+ }
+
+ return false;
}
} // namespace WebCore