Bug 31108 - [V8] REGRESSION: Pause on exception is broken
authorjianli@chromium.org <jianli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2009 18:33:59 +0000 (18:33 +0000)
committerjianli@chromium.org <jianli@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 5 Nov 2009 18:33:59 +0000 (18:33 +0000)
https://bugs.webkit.org/show_bug.cgi?id=31108

Reviewed by Pavel Feldman.

* bindings/v8/V8AbstractEventListener.cpp:
(WebCore::V8AbstractEventListener::invokeEventHandler):
* bindings/v8/V8Utilities.cpp:
(WebCore::reportException):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@50568 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bindings/v8/V8AbstractEventListener.cpp
WebCore/bindings/v8/V8Utilities.cpp

index 6ed4c09..fbce611 100644 (file)
@@ -1,5 +1,17 @@
 2009-11-05  Jian Li  <jianli@chromium.org>
 
+        Reviewed by Pavel Feldman.
+
+        Bug 31108 - [V8] REGRESSION: Pause on exception is broken
+        https://bugs.webkit.org/show_bug.cgi?id=31108
+
+        * bindings/v8/V8AbstractEventListener.cpp:
+        (WebCore::V8AbstractEventListener::invokeEventHandler):
+        * bindings/v8/V8Utilities.cpp:
+        (WebCore::reportException):
+
+2009-11-05  Jian Li  <jianli@chromium.org>
+
         Reviewed by Dmitri Titov.
 
         We should not bubble up events if we drag something to an iframe that
index 1ab2e04..fa462ad 100644 (file)
@@ -141,7 +141,6 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context
         tryCatch.Reset();
 
         // Call the event handler.
-        tryCatch.SetVerbose(false); // We do not want to report the exception to the inspector console.
         returnValue = callListenerFunction(context, jsEvent, event);
         if (!tryCatch.CanContinue())
             return;
@@ -153,7 +152,6 @@ void V8AbstractEventListener::invokeEventHandler(ScriptExecutionContext* context
         }
 
         // 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
index ecac358..b01399d 100644 (file)
@@ -147,7 +147,11 @@ void reportException(ScriptState* scriptState, v8::TryCatch& exceptionCatcher)
         sourceURL = toWebCoreString(message->GetScriptResourceName());
     }
 
-    getScriptExecutionContext(scriptState)->reportException(errorMessage, lineNumber, sourceURL);
+    // Do not report the exception if the current execution context is Document because we do not want to lead to duplicate error messages in the console.
+    // FIXME (31171): need better design to solve the duplicate error message reporting problem.
+    ScriptExecutionContext* context = getScriptExecutionContext(scriptState);
+    if (!context->isDocument())
+      context->reportException(errorMessage, lineNumber, sourceURL);
     exceptionCatcher.Reset();
 }