WebCore/ChangeLog

112008-05-20 Adam Roben <aroben@apple.com>
22
 3 Fix Bug 19153: Inspector should support console.debug
 4
 5 <https://bugs.webkit.org/show_bug.cgi?id=19153>
 6 <rdar://problem/5950856>
 7
 8 Reviewed by NOBODY (OOPS!).
 9
 10 Test: manual-tests/inspector/console-log-formatting.html
 11
 12 * bindings/js/JSConsoleCustom.cpp:
 13 (WebCore::JSConsole::debug): Added.
 14 * manual-tests/inspector/console-log-formatting.html: Changed to test
 15 console.debug as well.
 16 * page/Console.cpp:
 17 (WebCore::Console::debug): Added. Just calls through to log().
 18 * page/Console.h:
 19 * page/Console.idl: Added debug() declaration.
 20
 212008-05-20 Adam Roben <aroben@apple.com>
 22
323 Use KJS::List::getSlice instead of reimplementing it
424
525 Rubberstamped and suggested by Sam Weinig.

WebCore/bindings/js/JSConsoleCustom.cpp

@@using namespace KJS;
3232
3333namespace WebCore {
3434
 35JSValue* JSConsole::debug(ExecState* exec, const List& arguments)
 36{
 37 impl()->debug(exec, arguments);
 38 return jsUndefined();
 39}
 40
3541JSValue* JSConsole::error(ExecState* exec, const List& arguments)
3642{
3743 impl()->error(exec, arguments);

WebCore/manual-tests/inspector/console-log-formatting.html

1515 };
1616
1717 function test(args) {
18  console.info("console.log(%s)", args);
19  try {
20  eval("console.log(" + args + ")");
21  } catch (e) {
22  console.error(e);
 18 var functions = ["log", "debug"];
 19 for (var i = 0; i < functions.length; ++i) {
 20 console.info("console." + functions[i] + "(%s)", args);
 21 try {
 22 eval("console." + functions[i] + "(" + args + ")");
 23 } catch (e) {
 24 console.error(e);
 25 }
2326 }
2427 }
2528

WebCore/page/Console.cpp

@@void Console::addMessage(MessageSource source, MessageLevel level, const String&
6969 page->inspectorController()->addMessageToConsole(source, level, message, lineNumber, sourceURL);
7070}
7171
 72void Console::debug(ExecState* exec, const List& arguments)
 73{
 74 // In Firebug, console.debug has the same behavior as console.log. So we'll do the same.
 75 log(exec, arguments);
 76}
 77
7278void Console::error(ExecState* exec, const List& arguments)
7379{
7480 if (arguments.isEmpty())

WebCore/page/Console.h

@@namespace WebCore {
6666
6767 void addMessage(MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
6868
 69 void debug(KJS::ExecState*, const KJS::List& arguments);
6970 void error(KJS::ExecState*, const KJS::List& arguments);
7071 void info(KJS::ExecState*, const KJS::List& arguments);
7172 void log(KJS::ExecState*, const KJS::List& arguments);

WebCore/page/Console.idl

2929module window {
3030
3131 interface Console {
 32 [Custom] void debug();
3233 [Custom] void error();
3334 [Custom] void info();
3435 [Custom] void log();