Modified: tags/Safari-537.26.1/Source/WebCore/ChangeLog (140060 => 140061)
--- tags/Safari-537.26.1/Source/WebCore/ChangeLog 2013-01-17 23:25:59 UTC (rev 140060)
+++ tags/Safari-537.26.1/Source/WebCore/ChangeLog 2013-01-17 23:49:13 UTC (rev 140061)
@@ -1,5 +1,21 @@
2013-01-17 Lucas Forschler <lforsch...@apple.com>
+ Merge r139927
+
+ 2013-01-16 Timothy Hatcher <timo...@apple.com>
+
+ Fix a crash when printing console messages to STDOUT.
+
+ https://bugs.webkit.org/show_bug.cgi?id=107039
+
+ Reviewed by Joseph Pecoraro.
+
+ * page/Console.cpp:
+ (WebCore::internalAddMessage): Don't release the RefPtr early. Also log the line number
+ and convert non-string arguments to strings when printing them.
+
+2013-01-17 Lucas Forschler <lforsch...@apple.com>
+
Merge r139935
2013-01-16 Brady Eidson <beid...@apple.com>
Modified: tags/Safari-537.26.1/Source/WebCore/page/Console.cpp (140060 => 140061)
--- tags/Safari-537.26.1/Source/WebCore/page/Console.cpp 2013-01-17 23:25:59 UTC (rev 140060)
+++ tags/Safari-537.26.1/Source/WebCore/page/Console.cpp 2013-01-17 23:49:13 UTC (rev 140061)
@@ -201,7 +201,7 @@
String message;
bool gotMessage = arguments->getFirstArgumentAsString(message);
- InspectorInstrumentation::addMessageToConsole(page, ConsoleAPIMessageSource, type, level, message, state, arguments.release());
+ InspectorInstrumentation::addMessageToConsole(page, ConsoleAPIMessageSource, type, level, message, state, arguments);
if (!page->settings() || page->settings()->privateBrowsingEnabled())
return;
@@ -210,14 +210,14 @@
page->chrome()->client()->addMessageToConsole(ConsoleAPIMessageSource, type, level, message, lastCaller.lineNumber(), lastCaller.sourceURL());
if (printExceptions) {
- printSourceURLAndLine(lastCaller.sourceURL(), 0);
+ printSourceURLAndLine(lastCaller.sourceURL(), lastCaller.lineNumber());
printMessageSourceAndLevelPrefix(ConsoleAPIMessageSource, level);
for (unsigned i = 0; i < arguments->argumentCount(); ++i) {
- String argAsString;
- if (arguments->argumentAt(i).getString(arguments->globalState(), argAsString))
- printf(" %s", argAsString.utf8().data());
+ String argAsString = arguments->argumentAt(i).toString(arguments->globalState());
+ printf(" %s", argAsString.utf8().data());
}
+
printf("\n");
}