Title: [160240] trunk/Source/WebCore
Revision
160240
Author
[email protected]
Date
2013-12-06 12:55:54 -0800 (Fri, 06 Dec 2013)

Log Message

Simplify ScriptFunctionCall by removing dead code.
https://bugs.webkit.org/show_bug.cgi?id=125274

Patch by Joseph Pecoraro <[email protected]> on 2013-12-06
Reviewed by Timothy Hatcher.

* bindings/js/ScriptFunctionCall.cpp:
(WebCore::ScriptFunctionCall::call):
* bindings/js/ScriptFunctionCall.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (160239 => 160240)


--- trunk/Source/WebCore/ChangeLog	2013-12-06 20:38:43 UTC (rev 160239)
+++ trunk/Source/WebCore/ChangeLog	2013-12-06 20:55:54 UTC (rev 160240)
@@ -1,3 +1,14 @@
+2013-12-06  Joseph Pecoraro  <[email protected]>
+
+        Simplify ScriptFunctionCall by removing dead code.
+        https://bugs.webkit.org/show_bug.cgi?id=125274
+
+        Reviewed by Timothy Hatcher.
+
+        * bindings/js/ScriptFunctionCall.cpp:
+        (WebCore::ScriptFunctionCall::call):
+        * bindings/js/ScriptFunctionCall.h:
+
 2013-12-06  Daniel Bates  <[email protected]>
 
         [iOS] Upstream WebCore/rendering changes

Modified: trunk/Source/WebCore/bindings/js/ScriptFunctionCall.cpp (160239 => 160240)


--- trunk/Source/WebCore/bindings/js/ScriptFunctionCall.cpp	2013-12-06 20:38:43 UTC (rev 160239)
+++ trunk/Source/WebCore/bindings/js/ScriptFunctionCall.cpp	2013-12-06 20:55:54 UTC (rev 160240)
@@ -31,7 +31,6 @@
 #include "config.h"
 #include "ScriptFunctionCall.h"
 
-#include "JSDOMBinding.h"
 #include "JSMainThreadExecState.h"
 #include "ScriptValue.h"
 
@@ -115,7 +114,7 @@
 {
 }
 
-ScriptValue ScriptFunctionCall::call(bool& hadException, bool reportExceptions)
+ScriptValue ScriptFunctionCall::call(bool& hadException)
 {
     JSObject* thisObject = m_thisObject.jsObject();
 
@@ -123,9 +122,6 @@
 
     JSValue function = thisObject->get(m_exec, Identifier(m_exec, m_name));
     if (m_exec->hadException()) {
-        if (reportExceptions)
-            reportException(m_exec, m_exec->exception());
-
         hadException = true;
         return ScriptValue();
     }
@@ -142,9 +138,6 @@
         result = JSC::call(m_exec, function, callType, callData, thisObject, m_arguments);
 
     if (m_exec->hadException()) {
-        if (reportExceptions)
-            reportException(m_exec, m_exec->exception());
-
         hadException = true;
         return ScriptValue();
     }
@@ -158,62 +151,4 @@
     return call(hadException);
 }
 
-ScriptObject ScriptFunctionCall::construct(bool& hadException, bool reportExceptions)
-{
-    JSObject* thisObject = m_thisObject.jsObject();
-
-    JSLockHolder lock(m_exec);
-
-    JSObject* constructor = asObject(thisObject->get(m_exec, Identifier(m_exec, m_name)));
-    if (m_exec->hadException()) {
-        if (reportExceptions)
-            reportException(m_exec, m_exec->exception());
-
-        hadException = true;
-        return ScriptObject();
-    }
-
-    ConstructData constructData;
-    ConstructType constructType = constructor->methodTable()->getConstructData(constructor, constructData);
-    if (constructType == ConstructTypeNone)
-        return ScriptObject();
-
-    JSValue result = JSC::construct(m_exec, constructor, constructType, constructData, m_arguments);
-    if (m_exec->hadException()) {
-        if (reportExceptions)
-            reportException(m_exec, m_exec->exception());
-
-        hadException = true;
-        return ScriptObject();
-    }
-
-    return ScriptObject(m_exec, asObject(result));
-}
-
-ScriptCallback::ScriptCallback(JSC::ExecState* state, const ScriptValue& function)
-    : ScriptCallArgumentHandler(state)
-    , m_function(function)
-{
-}
-
-ScriptValue ScriptCallback::call()
-{
-    JSLockHolder lock(m_exec);
-
-    CallData callData;
-    CallType callType = getCallData(m_function.jsValue(), callData);
-    if (callType == CallTypeNone)
-        return ScriptValue();
-
-    JSValue result = JSC::call(m_exec, m_function.jsValue(), callType, callData, m_function.jsValue(), m_arguments);
-    bool hadException = m_exec->hadException();
-
-    if (hadException) {
-        reportException(m_exec, m_exec->exception());
-        return ScriptValue();
-    }
-
-    return ScriptValue(m_exec->vm(), result);
-}
-
 } // namespace WebCore

Modified: trunk/Source/WebCore/bindings/js/ScriptFunctionCall.h (160239 => 160240)


--- trunk/Source/WebCore/bindings/js/ScriptFunctionCall.h	2013-12-06 20:38:43 UTC (rev 160239)
+++ trunk/Source/WebCore/bindings/js/ScriptFunctionCall.h	2013-12-06 20:55:54 UTC (rev 160240)
@@ -74,25 +74,14 @@
     class ScriptFunctionCall : public ScriptCallArgumentHandler {
     public:
         ScriptFunctionCall(const ScriptObject& thisObject, const String& name);
-        ScriptValue call(bool& hadException, bool reportExceptions = true);
+        ScriptValue call(bool& hadException);
         ScriptValue call();
-        ScriptObject construct(bool& hadException, bool reportExceptions = true);
 
     protected:
         ScriptObject m_thisObject;
         String m_name;
     };
 
-    class ScriptCallback : public ScriptCallArgumentHandler {
-    public:
-        ScriptCallback(JSC::ExecState*, const ScriptValue&);
-
-        ScriptValue call();
-
-    private:
-        ScriptValue m_function;
-    };
-
 } // namespace WebCore
 
 #endif // ScriptFunctionCall
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to