]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - inspector/agents/JSGlobalObjectDebuggerAgent.cpp
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / inspector / agents / JSGlobalObjectDebuggerAgent.cpp
index c087e81e97cc41e8eef4f14a2958ade825e42fb0..9ae76c62a6c9c5ab03c70915d2d231d8ff673de9 100644 (file)
@@ -26,8 +26,7 @@
 #include "config.h"
 #include "JSGlobalObjectDebuggerAgent.h"
 
-#if ENABLE(INSPECTOR)
-
+#include "ConsoleMessage.h"
 #include "InjectedScriptManager.h"
 #include "InspectorConsoleAgent.h"
 #include "JSGlobalObject.h"
@@ -56,10 +55,10 @@ void JSGlobalObjectDebuggerAgent::stopListeningScriptDebugServer(bool isBeingDes
     scriptDebugServer().removeListener(this, isBeingDestroyed);
 }
 
-InjectedScript JSGlobalObjectDebuggerAgent::injectedScriptForEval(ErrorString* error, const int* executionContextId)
+InjectedScript JSGlobalObjectDebuggerAgent::injectedScriptForEval(ErrorString& error, const int* executionContextId)
 {
     if (executionContextId) {
-        *error = ASCIILiteral("Execution context id is not supported for JSContext inspection as there is only one execution context.");
+        error = ASCIILiteral("Execution context id is not supported for JSContext inspection as there is only one execution context.");
         return InjectedScript();
     }
 
@@ -69,9 +68,7 @@ InjectedScript JSGlobalObjectDebuggerAgent::injectedScriptForEval(ErrorString* e
 
 void JSGlobalObjectDebuggerAgent::breakpointActionLog(JSC::ExecState* exec, const String& message)
 {
-    m_consoleAgent->addMessageToConsole(MessageSource::JS, MessageType::Log, MessageLevel::Log, message, createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture), 0);
+    m_consoleAgent->addMessageToConsole(std::make_unique<ConsoleMessage>(MessageSource::JS, MessageType::Log, MessageLevel::Log, message, createScriptCallStack(exec, ScriptCallStack::maxCallStackSizeToCapture), 0));
 }
 
 } // namespace Inspector
-
-#endif // ENABLE(INSPECTOR)