Bug 24329 - REGRESSION: console.dirxml() Console API broken
Summary: REGRESSION: console.dirxml() Console API broken
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Timothy Hatcher
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-03-03 10:23 PST by Timothy Hatcher
Modified: 2009-03-03 14:28 PST (History)
3 users (show)

See Also:


Attachments
Proposed Patch (24.01 KB, patch)
2009-03-03 10:58 PST, Timothy Hatcher
kmccullough: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Timothy Hatcher 2009-03-03 10:23:53 PST
* SUMMARY
The console.dirxml (from firebug's console API) added in r36255 seems broken in r38297 

* STEPS TO REPRODUCE
Type 'console.dirxml(document.body)' on google.com

Expected: Should return something like https://bugs.webkit.org/attachment.cgi?id=22833

Currently (WebKit r38297 and Safari 4) doesn't print anything in the console. Works great in Firefox.

<rdar://problem/6367127>
Comment 1 Timothy Hatcher 2009-03-03 10:58:41 PST
Created attachment 28231 [details]
Proposed Patch
Comment 2 Kevin McCullough 2009-03-03 13:37:18 PST
Comment on attachment 28231 [details]
Proposed Patch


> diff --git a/WebCore/page/Console.cpp b/WebCore/page/Console.cpp
> index 8755f0e..697baac 100644
> --- a/WebCore/page/Console.cpp
> +++ b/WebCore/page/Console.cpp
> @@ -109,12 +109,13 @@ static void printMessageSourceAndLevelPrefix(MessageSource source, MessageLevel
>  
>      const char* levelString;
>      switch (level) {
> +        default:
> +            ASSERT_NOT_REACHED();
> +            levelString = "UNKNOWN";
> +            break;

We usually put the default: at the end of the switch statement

It would be nice if the refactoring was in a separate patch but I don't have many comments and it's good that there is a test case.
Comment 3 Timothy Hatcher 2009-03-03 14:28:02 PST
Fixed in r41404.