[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

jianli at chromium.org jianli at chromium.org
Thu Oct 29 20:31:36 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit ccdcd88373dd8c9baa7c87172e7854565ba8f210
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 22 00:07:49 2009 +0000

    [V8] Run-time exception in onmessage handler is not forwarded to the
    worker object.
    https://bugs.webkit.org/show_bug.cgi?id=28980
    
    Reviewed by David Levin.
    
    The previous fix was partially reverted due to a reliability build break
    in chromium. The break happens when an exception is thrown without
    setting a message. We need to check for this scenario and handle it.
    
    Tested by worker-close.html.
    
    * bindings/v8/V8AbstractEventListener.cpp:
    (WebCore::V8AbstractEventListener::invokeEventHandler):
    * bindings/v8/V8Utilities.cpp:
    (WebCore::reportException):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48610 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8773a8d..3fdd939 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,22 @@
+2009-09-21  Jian Li  <jianli at chromium.org>
+
+        Reviewed by David Levin.
+
+        [V8] Run-time exception in onmessage handler is not forwarded to the
+        worker object.
+        https://bugs.webkit.org/show_bug.cgi?id=28980
+
+        The previous fix was partially reverted due to a reliability build break
+        in chromium. The break happens when an exception is thrown without
+        setting a message. We need to check for this scenario and handle it.
+
+        Tested by worker-close.html.
+
+        * bindings/v8/V8AbstractEventListener.cpp:
+        (WebCore::V8AbstractEventListener::invokeEventHandler):
+        * bindings/v8/V8Utilities.cpp:
+        (WebCore::reportException):
+
 2009-09-21  Greg Bolsinga  <bolsinga at apple.com>
 
         Reviewed by Simon Fraser & Sam Weinig.
diff --git a/WebCore/bindings/v8/V8AbstractEventListener.cpp b/WebCore/bindings/v8/V8AbstractEventListener.cpp
index 588ea6c..c0efea5 100644
--- a/WebCore/bindings/v8/V8AbstractEventListener.cpp
+++ b/WebCore/bindings/v8/V8AbstractEventListener.cpp
@@ -82,10 +82,17 @@ void V8AbstractEventListener::invokeEventHandler(v8::Handle<v8::Context> v8Conte
         tryCatch.Reset();
 
         // Call the event handler.
+        tryCatch.SetVerbose(false); // We do not want to report the exception to the inspector console.
         returnValue = callListenerFunction(jsEvent, event, isWindowEvent);
-        tryCatch.Reset();
+
+        // If an error occurs while handling the event, it should be reported.
+        if (tryCatch.HasCaught()) {
+            reportException(0, tryCatch);
+            tryCatch.Reset();
+        }
 
         // Restore the old event. This must be done for all exit paths through this method.
+        tryCatch.SetVerbose(true);
         if (savedEvent.IsEmpty())
             v8Context->Global()->SetHiddenValue(eventSymbol, v8::Undefined());
         else
diff --git a/WebCore/bindings/v8/V8Utilities.cpp b/WebCore/bindings/v8/V8Utilities.cpp
index a8aa924..f8f7d7c 100644
--- a/WebCore/bindings/v8/V8Utilities.cpp
+++ b/WebCore/bindings/v8/V8Utilities.cpp
@@ -129,8 +129,21 @@ ScriptExecutionContext* getScriptExecutionContext(ScriptState* scriptState)
 
 void reportException(ScriptState* scriptState, v8::TryCatch& exceptionCatcher)
 {
+    String errorMessage;
+    int lineNumber = 0;
+    String sourceURL;
+
+    // There can be a situation that an exception is thrown without setting a message.
     v8::Local<v8::Message> message = exceptionCatcher.Message();
-    getScriptExecutionContext(scriptState)->reportException(toWebCoreString(message->Get()), message->GetLineNumber(), toWebCoreString(message->GetScriptResourceName()));
+    if (message.IsEmpty())
+        errorMessage = toWebCoreString(exceptionCatcher.Exception()->ToString());
+    else {
+        errorMessage = toWebCoreString(message->Get());
+        lineNumber = message->GetLineNumber();
+        sourceURL = toWebCoreString(message->GetScriptResourceName());
+    }
+
+    getScriptExecutionContext(scriptState)->reportException(errorMessage, lineNumber, sourceURL);
     exceptionCatcher.Reset();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list