summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-09-01 02:23:20 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-09-01 02:23:20 -0700
commit4d19269bce7d5e32eb2c3cc1f469d207d8b15bb1 (patch)
tree86a04abfab53bc04470a3abea8ae721cd4bd663a /WebCore/bindings
parente7f607ca3a06ec0129f0f95a529df91146876fff (diff)
parent377c793d7f2f00841bc549f4831059755004e4c4 (diff)
downloadexternal_webkit-4d19269bce7d5e32eb2c3cc1f469d207d8b15bb1.zip
external_webkit-4d19269bce7d5e32eb2c3cc1f469d207d8b15bb1.tar.gz
external_webkit-4d19269bce7d5e32eb2c3cc1f469d207d8b15bb1.tar.bz2
Merge change 23087 into eclair
* changes: 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