Title: [117579] trunk/Source/WebCore
Revision
117579
Author
[email protected]
Date
2012-05-18 05:32:42 -0700 (Fri, 18 May 2012)

Log Message

[V8][Refactoring] Remove V8Proxy::throwError(const char*, ErrorType, v8::Isolate*=0)
https://bugs.webkit.org/show_bug.cgi?id=86802

Reviewed by Adam Barth.

As commented here (https://bugs.webkit.org/show_bug.cgi?id=84074#c5),
I am refactoring a series of confusing throwError()s. This would be
the final patch for the refactoring.

This patch removes V8Proxy::throwError(const char*, ErrorType, v8::Isolate*=0).
Also this patch refactors up a couple of throwError()s that I've forgot to
refactor in the previous patches.

No tests. No change in behavior.

* bindings/v8/V8NodeFilterCondition.cpp:
(WebCore::V8NodeFilterCondition::acceptNode):
* bindings/v8/V8Proxy.h:
* bindings/v8/custom/V8ArrayBufferCustom.cpp:
(WebCore::V8ArrayBuffer::constructorCallback):
* bindings/v8/custom/V8ArrayBufferViewCustom.h:
(WebCore::constructWebGLArray):
* bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
(WebCore::V8SQLResultSetRowList::itemCallback):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (117578 => 117579)


--- trunk/Source/WebCore/ChangeLog	2012-05-18 11:28:02 UTC (rev 117578)
+++ trunk/Source/WebCore/ChangeLog	2012-05-18 12:32:42 UTC (rev 117579)
@@ -1,3 +1,30 @@
+2012-05-18  Kentaro Hara  <[email protected]>
+
+        [V8][Refactoring] Remove V8Proxy::throwError(const char*, ErrorType, v8::Isolate*=0)
+        https://bugs.webkit.org/show_bug.cgi?id=86802
+
+        Reviewed by Adam Barth.
+
+        As commented here (https://bugs.webkit.org/show_bug.cgi?id=84074#c5),
+        I am refactoring a series of confusing throwError()s. This would be
+        the final patch for the refactoring.
+
+        This patch removes V8Proxy::throwError(const char*, ErrorType, v8::Isolate*=0).
+        Also this patch refactors up a couple of throwError()s that I've forgot to
+        refactor in the previous patches.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/V8NodeFilterCondition.cpp:
+        (WebCore::V8NodeFilterCondition::acceptNode):
+        * bindings/v8/V8Proxy.h:
+        * bindings/v8/custom/V8ArrayBufferCustom.cpp:
+        (WebCore::V8ArrayBuffer::constructorCallback):
+        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+        (WebCore::constructWebGLArray):
+        * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
+        (WebCore::V8SQLResultSetRowList::itemCallback):
+
 2012-05-18  MORITA Hajime <[email protected]>
 
         Unreviewed attempt to fix build breakage on r117572

Modified: trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp (117578 => 117579)


--- trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp	2012-05-18 11:28:02 UTC (rev 117578)
+++ trunk/Source/WebCore/bindings/v8/V8NodeFilterCondition.cpp	2012-05-18 12:32:42 UTC (rev 117579)
@@ -73,7 +73,7 @@
     else {
         v8::Local<v8::Value> value = m_filter->ToObject()->Get(v8::String::New("acceptNode"));
         if (!value->IsFunction()) {
-            V8Proxy::throwError(V8Proxy::TypeError, "NodeFilter object does not have an acceptNode function");
+            V8Proxy::throwTypeError("NodeFilter object does not have an acceptNode function");
             return NodeFilter::FILTER_REJECT;
         }
         callback = v8::Handle<v8::Function>::Cast(value);

Modified: trunk/Source/WebCore/bindings/v8/V8Proxy.h (117578 => 117579)


--- trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-05-18 11:28:02 UTC (rev 117578)
+++ trunk/Source/WebCore/bindings/v8/V8Proxy.h	2012-05-18 12:32:42 UTC (rev 117579)
@@ -320,13 +320,6 @@
         return v8::Local<v8::Object>();
     }
 
-    inline v8::Handle<v8::Primitive> throwError(const char* message, V8Proxy::ErrorType type, v8::Isolate* isolate = 0)
-    {
-        if (!v8::V8::IsExecutionTerminating())
-            V8Proxy::throwError(type, message, isolate);
-        return v8::Undefined();
-    }
-
     inline v8::Handle<v8::Primitive> throwError(ExceptionCode ec, v8::Isolate* isolate = 0)
     {
         if (!v8::V8::IsExecutionTerminating())

Modified: trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp (117578 => 117579)


--- trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp	2012-05-18 11:28:02 UTC (rev 117578)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp	2012-05-18 12:32:42 UTC (rev 117579)
@@ -43,7 +43,7 @@
     INC_STATS("DOM.ArrayBuffer.Constructor");
 
     if (!args.IsConstructCall())
-        return throwError("DOM object constructor cannot be called as a function.", V8Proxy::TypeError);
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();

Modified: trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h (117578 => 117579)


--- trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h	2012-05-18 11:28:02 UTC (rev 117578)
+++ trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h	2012-05-18 12:32:42 UTC (rev 117579)
@@ -139,7 +139,7 @@
     if (args[0]->IsNull()) {
         // Invalid first argument
         // FIXME: use forthcoming V8Proxy::throwTypeError().
-        return V8Proxy::throwError(V8Proxy::TypeError, "Type error");
+        return V8Proxy::throwTypeError();
     }
 
     // See whether the first argument is a ArrayBuffer.

Modified: trunk/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp (117578 => 117579)


--- trunk/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp	2012-05-18 11:28:02 UTC (rev 117578)
+++ trunk/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp	2012-05-18 12:32:42 UTC (rev 117579)
@@ -49,7 +49,7 @@
     }
 
     if (!args[0]->IsNumber()) {
-        V8Proxy::throwError(V8Proxy::TypeError, "Item index must be a number.");
+        V8Proxy::throwTypeError("Item index must be a number.");
         return v8::Undefined();
     }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to