Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (200403 => 200404)
--- trunk/Source/_javascript_Core/ChangeLog 2016-05-04 01:46:30 UTC (rev 200403)
+++ trunk/Source/_javascript_Core/ChangeLog 2016-05-04 01:54:39 UTC (rev 200404)
@@ -1,3 +1,25 @@
+2016-05-03 Joseph Pecoraro <[email protected]>
+
+ Web Inspector: Simplify console.clear
+ https://bugs.webkit.org/show_bug.cgi?id=157316
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/ScriptArguments.cpp:
+ (Inspector::ScriptArguments::createEmpty):
+ (Inspector::ScriptArguments::ScriptArguments):
+ * inspector/ScriptArguments.h:
+ Provide a way to create an empty list.
+
+ * runtime/ConsoleClient.cpp:
+ (JSC::ConsoleClient::clear):
+ * runtime/ConsoleClient.h:
+ Drop unnecessary parameter.
+
+ * runtime/ConsoleObject.cpp:
+ (JSC::consoleProtoFuncClear):
+ No need to parse arguments.
+
2016-05-03 Yusuke Suzuki <[email protected]>
Improve Symbol() to string coercion error message
Modified: trunk/Source/_javascript_Core/inspector/ScriptArguments.cpp (200403 => 200404)
--- trunk/Source/_javascript_Core/inspector/ScriptArguments.cpp 2016-05-04 01:46:30 UTC (rev 200403)
+++ trunk/Source/_javascript_Core/inspector/ScriptArguments.cpp 2016-05-04 01:54:39 UTC (rev 200404)
@@ -42,6 +42,16 @@
return adoptRef(*new ScriptArguments(scriptState, arguments));
}
+Ref<ScriptArguments> ScriptArguments::createEmpty(JSC::ExecState* scriptState)
+{
+ return adoptRef(*new ScriptArguments(scriptState));
+}
+
+ScriptArguments::ScriptArguments(JSC::ExecState* execState)
+ : m_globalObject(execState->vm(), execState->lexicalGlobalObject())
+{
+}
+
ScriptArguments::ScriptArguments(JSC::ExecState* execState, Vector<Deprecated::ScriptValue>& arguments)
: m_globalObject(execState->vm(), execState->lexicalGlobalObject())
{
Modified: trunk/Source/_javascript_Core/inspector/ScriptArguments.h (200403 => 200404)
--- trunk/Source/_javascript_Core/inspector/ScriptArguments.h 2016-05-04 01:46:30 UTC (rev 200403)
+++ trunk/Source/_javascript_Core/inspector/ScriptArguments.h 2016-05-04 01:54:39 UTC (rev 200404)
@@ -52,6 +52,7 @@
class JS_EXPORT_PRIVATE ScriptArguments : public RefCounted<ScriptArguments> {
public:
static Ref<ScriptArguments> create(JSC::ExecState*, Vector<Deprecated::ScriptValue>& arguments);
+ static Ref<ScriptArguments> createEmpty(JSC::ExecState*);
~ScriptArguments();
const Deprecated::ScriptValue& argumentAt(size_t) const;
@@ -63,6 +64,7 @@
bool isEqual(ScriptArguments*) const;
private:
+ ScriptArguments(JSC::ExecState*);
ScriptArguments(JSC::ExecState*, Vector<Deprecated::ScriptValue>& arguments);
JSC::Strong<JSC::JSGlobalObject> m_globalObject;
Modified: trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp (200403 => 200404)
--- trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp 2016-05-04 01:46:30 UTC (rev 200403)
+++ trunk/Source/_javascript_Core/runtime/ConsoleClient.cpp 2016-05-04 01:54:39 UTC (rev 200404)
@@ -203,9 +203,9 @@
internalMessageWithTypeAndLevel(MessageType::Log, level, exec, WTFMove(arguments), ArgumentRequired);
}
-void ConsoleClient::clear(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
+void ConsoleClient::clear(ExecState* exec)
{
- internalMessageWithTypeAndLevel(MessageType::Clear, MessageLevel::Log, exec, WTFMove(arguments), ArgumentNotRequired);
+ internalMessageWithTypeAndLevel(MessageType::Clear, MessageLevel::Log, exec, ScriptArguments::createEmpty(exec), ArgumentNotRequired);
}
void ConsoleClient::dir(ExecState* exec, RefPtr<ScriptArguments>&& arguments)
Modified: trunk/Source/_javascript_Core/runtime/ConsoleClient.h (200403 => 200404)
--- trunk/Source/_javascript_Core/runtime/ConsoleClient.h 2016-05-04 01:46:30 UTC (rev 200403)
+++ trunk/Source/_javascript_Core/runtime/ConsoleClient.h 2016-05-04 01:54:39 UTC (rev 200404)
@@ -45,7 +45,7 @@
JS_EXPORT_PRIVATE static void printConsoleMessageWithArguments(MessageSource, MessageType, MessageLevel, JSC::ExecState*, RefPtr<Inspector::ScriptArguments>&&);
void logWithLevel(ExecState*, RefPtr<Inspector::ScriptArguments>&&, MessageLevel);
- void clear(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
+ void clear(ExecState*);
void dir(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
void dirXML(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
void table(ExecState*, RefPtr<Inspector::ScriptArguments>&&);
Modified: trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp (200403 => 200404)
--- trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp 2016-05-04 01:46:30 UTC (rev 200403)
+++ trunk/Source/_javascript_Core/runtime/ConsoleObject.cpp 2016-05-04 01:54:39 UTC (rev 200404)
@@ -146,8 +146,7 @@
if (!client)
return JSValue::encode(jsUndefined());
- RefPtr<Inspector::ScriptArguments> arguments(Inspector::createScriptArguments(exec, 0));
- client->clear(exec, WTFMove(arguments));
+ client->clear(exec);
return JSValue::encode(jsUndefined());
}