OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 if (!acceptNoArguments && !arguments->argumentCount()) | 181 if (!acceptNoArguments && !arguments->argumentCount()) |
182 return; | 182 return; |
183 | 183 |
184 if (Console::shouldPrintExceptions()) { | 184 if (Console::shouldPrintExceptions()) { |
185 printSourceURLAndLine(lastCaller.sourceURL(), 0); | 185 printSourceURLAndLine(lastCaller.sourceURL(), 0); |
186 printMessageSourceAndLevelPrefix(ConsoleAPIMessageSource, level); | 186 printMessageSourceAndLevelPrefix(ConsoleAPIMessageSource, level); |
187 | 187 |
188 for (unsigned i = 0; i < arguments->argumentCount(); ++i) { | 188 for (unsigned i = 0; i < arguments->argumentCount(); ++i) { |
189 String argAsString; | 189 String argAsString; |
190 if (arguments->argumentAt(i).getString(arguments->globalState(), arg
AsString)) | 190 if (arguments->argumentGetString(i, argAsString)) |
191 printf(" %s", argAsString.utf8().data()); | 191 printf(" %s", argAsString.utf8().data()); |
192 } | 192 } |
193 printf("\n"); | 193 printf("\n"); |
194 } | 194 } |
195 | 195 |
196 String message; | 196 String message; |
197 if (arguments->getFirstArgumentAsString(message)) | 197 if (arguments->argumentToString(0, message)) |
198 page->chrome()->client()->addMessageToConsole(ConsoleAPIMessageSource, t
ype, level, message, lastCaller.lineNumber(), lastCaller.sourceURL()); | 198 page->chrome()->client()->addMessageToConsole(ConsoleAPIMessageSource, t
ype, level, message, lastCaller.lineNumber(), lastCaller.sourceURL()); |
199 | 199 |
200 InspectorInstrumentation::addMessageToConsole(page, ConsoleAPIMessageSource,
type, level, message, arguments, callStack); | 200 InspectorInstrumentation::addMessageToConsole(page, ConsoleAPIMessageSource,
type, level, message, arguments, callStack); |
201 } | 201 } |
202 | 202 |
203 void Console::debug(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCall
Stack> callStack) | 203 void Console::debug(PassRefPtr<ScriptArguments> arguments, PassRefPtr<ScriptCall
Stack> callStack) |
204 { | 204 { |
205 // In Firebug, console.debug has the same behavior as console.log. So we'll
do the same. | 205 // In Firebug, console.debug has the same behavior as console.log. So we'll
do the same. |
206 log(arguments, callStack); | 206 log(arguments, callStack); |
207 } | 207 } |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 } | 380 } |
381 | 381 |
382 Page* Console::page() const | 382 Page* Console::page() const |
383 { | 383 { |
384 if (!m_frame) | 384 if (!m_frame) |
385 return 0; | 385 return 0; |
386 return m_frame->page(); | 386 return m_frame->page(); |
387 } | 387 } |
388 | 388 |
389 } // namespace WebCore | 389 } // namespace WebCore |
OLD | NEW |