Title: [200371] trunk/Source/_javascript_Core
Revision
200371
Author
[email protected]
Date
2016-05-03 08:24:36 -0700 (Tue, 03 May 2016)

Log Message

Web Inspector: console.assert should do far less work when the assertion is true
https://bugs.webkit.org/show_bug.cgi?id=157297
<rdar://problem/26056556>

Patch by Joseph Pecoraro <[email protected]> on 2016-05-03
Reviewed by Timothy Hatcher.

* runtime/ConsoleClient.h:
* runtime/ConsoleClient.cpp:
(JSC::ConsoleClient::assertion):
(JSC::ConsoleClient::assertCondition): Deleted.
Rename, now that this will only get called when the assertion failed.

* runtime/ConsoleObject.cpp:
(JSC::consoleProtoFuncAssert):
Avoid doing any work if the assertion succeeded.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (200370 => 200371)


--- trunk/Source/_javascript_Core/ChangeLog	2016-05-03 15:23:53 UTC (rev 200370)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-05-03 15:24:36 UTC (rev 200371)
@@ -1,5 +1,23 @@
 2016-05-03  Joseph Pecoraro  <[email protected]>
 
+        Web Inspector: console.assert should do far less work when the assertion is true
+        https://bugs.webkit.org/show_bug.cgi?id=157297
+        <rdar://problem/26056556>
+
+        Reviewed by Timothy Hatcher.
+
+        * runtime/ConsoleClient.h:
+        * runtime/ConsoleClient.cpp:
+        (JSC::ConsoleClient::assertion):
+        (JSC::ConsoleClient::assertCondition): Deleted.
+        Rename, now that this will only get called when the assertion failed.
+
+        * runtime/ConsoleObject.cpp:
+        (JSC::consoleProtoFuncAssert):
+        Avoid doing any work if the assertion succeeded.
+
+2016-05-03  Joseph Pecoraro  <[email protected]>
+
         Unreviewed follow-up testapi fix after r200355.
 
         * runtime/JSGlobalObject.cpp:

Modified: trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp (200370 => 200371)


--- trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp	2016-05-03 15:23:53 UTC (rev 200370)
+++ trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp	2016-05-03 15:24:36 UTC (rev 200371)
@@ -228,11 +228,8 @@
     internalMessageWithTypeAndLevel(MessageType::Trace, MessageLevel::Log, exec, WTFMove(arguments), ArgumentNotRequired);
 }
 
-void ConsoleClient::assertCondition(ExecState* exec, RefPtr<ScriptArguments>&& arguments, bool condition)
+void ConsoleClient::assertion(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
 {
-    if (condition)
-        return;
-
     internalMessageWithTypeAndLevel(MessageType::Assert, MessageLevel::Error, exec, WTFMove(arguments), ArgumentNotRequired);
 }
 

Modified: trunk/Source/_javascript_Core/runtime/ConsoleClient.h (200370 => 200371)


--- trunk/Source/_javascript_Core/runtime/ConsoleClient.h	2016-05-03 15:23:53 UTC (rev 200370)
+++ trunk/Source/_javascript_Core/runtime/ConsoleClient.h	2016-05-03 15:24:36 UTC (rev 200371)
@@ -50,7 +50,7 @@
     void dirXML(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
     void table(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
     void trace(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
-    void assertCondition(ExecState*, RefPtr<Inspector::ScriptArguments>&&, bool condition);
+    void assertion(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
     void group(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
     void groupCollapsed(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
     void groupEnd(ExecState*, RefPtr<Inspector::ScriptArguments>&&);

Modified: trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp (200370 => 200371)


--- trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp	2016-05-03 15:23:53 UTC (rev 200370)
+++ trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp	2016-05-03 15:24:36 UTC (rev 200371)
@@ -201,12 +201,15 @@
     if (!client)
         return JSValue::encode(jsUndefined());
 
-    bool condition(exec->argument(0).toBoolean(exec));
+    bool condition = exec->argument(0).toBoolean(exec);
     if (exec->hadException())
         return JSValue::encode(jsUndefined());
 
+    if (condition)
+        return JSValue::encode(jsUndefined());
+
     RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 1));
-    client->assertCondition(exec, arguments.release(), condition);
+    client->assertion(exec, arguments.release());
     return JSValue::encode(jsUndefined());
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to