Title: [124634] trunk/Source/WebCore
Revision
124634
Author
[email protected]
Date
2012-08-03 11:54:07 -0700 (Fri, 03 Aug 2012)

Log Message

[V8] Add an IsExecutionTerminating() check to setDOMException()
https://bugs.webkit.org/show_bug.cgi?id=93101

Reviewed by Adam Barth.

In preparation for moving exception related code from V8Proxy to V8Binding,
I am going to remove throwError(ExceptionCode, v8::Isolate*) from V8Proxy.
throwError(ExceptionCode, v8::Isolate*) will be replaced with
setDOMException(ExceptionCode, v8::Isolate*). By this refactoring,
the way to throw _javascript_ errors and DOM exceptions becomes simple:
"Throw _javascript_ errors by throwError(). Throw DOM exceptions by setDOMException()".
(Currently some DOM exceptions are being thrown by throwError().)

To keep the current behavior of throwError(ExceptionCode, v8::Isolate*),
before the replacement, we need to insert the IsExecutionTerminating()
check to setDOMException(). This will add an extra check to the current
setDOMException(), but I don't think it's a problem.

No tests. No change in behavior.

* bindings/v8/V8Proxy.cpp:
(WebCore::V8Proxy::setDOMException):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (124633 => 124634)


--- trunk/Source/WebCore/ChangeLog	2012-08-03 18:39:31 UTC (rev 124633)
+++ trunk/Source/WebCore/ChangeLog	2012-08-03 18:54:07 UTC (rev 124634)
@@ -1,3 +1,28 @@
+2012-08-03  Kentaro Hara  <[email protected]>
+
+        [V8] Add an IsExecutionTerminating() check to setDOMException()
+        https://bugs.webkit.org/show_bug.cgi?id=93101
+
+        Reviewed by Adam Barth.
+
+        In preparation for moving exception related code from V8Proxy to V8Binding,
+        I am going to remove throwError(ExceptionCode, v8::Isolate*) from V8Proxy.
+        throwError(ExceptionCode, v8::Isolate*) will be replaced with
+        setDOMException(ExceptionCode, v8::Isolate*). By this refactoring,
+        the way to throw _javascript_ errors and DOM exceptions becomes simple:
+        "Throw _javascript_ errors by throwError(). Throw DOM exceptions by setDOMException()".
+        (Currently some DOM exceptions are being thrown by throwError().)
+
+        To keep the current behavior of throwError(ExceptionCode, v8::Isolate*),
+        before the replacement, we need to insert the IsExecutionTerminating()
+        check to setDOMException(). This will add an extra check to the current
+        setDOMException(), but I don't think it's a problem.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8Proxy.cpp:
+        (WebCore::V8Proxy::setDOMException):
+
 2012-08-03  Sadrul Habib Chowdhury  <[email protected]>
 
         Avoid dispatching gesture events of unknown types

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.cpp (124633 => 124634)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-03 18:39:31 UTC (rev 124633)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.cpp	2012-08-03 18:54:07 UTC (rev 124634)
@@ -546,7 +546,7 @@
 
 v8::Handle<v8::Value> V8Proxy::setDOMException(int ec, v8::Isolate* isolate)
 {
-    if (ec <= 0)
+    if (ec <= 0 || v8::V8::IsExecutionTerminating())
         return v8::Handle<v8::Value>();
 
     if (ec == NATIVE_TYPE_ERR) {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to