Bug 18888

Summary: REGRESSION (r32731): console.log always prints "undefined"
Product: WebKit Reporter: Matt Lilek <dev+webkit>
Component: Web Inspector (Deprecated)Assignee: Adam Roben (:aroben) <aroben>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, timothy
Priority: P1 Keywords: HasReduction, Regression
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
URL: data:text/html,<button onclick="javascript:console.log(document.body); alert(document.body);">Log document.body</button>
Attachments:
Description Flags
patch v1 with ChangeLog timothy: review+

Description Matt Lilek 2008-05-04 13:44:52 PDT
Load the URL on this bug and open the Inspector's console and click the button in the testcase.  The inspector incorrectly shows it as "undefined" while the alert() shows it properly as "[object HTMLBodyElement]".

I'm not sure whether this is a bug in the inspector or JSCore or elsewhere, but it is a regression from Safari 3.1.1.
Comment 1 Matt Lilek 2008-05-14 11:24:26 PDT
This is actually a bug in the inspector
Comment 2 Timothy Hatcher 2008-05-14 13:10:44 PDT
This affects logging any object. Try console.log({}) and it gives undefined.
Comment 3 Adam Roben (:aroben) 2008-05-14 14:05:55 PDT
Created attachment 21136 [details]
patch v1 with ChangeLog
Comment 4 Adam Roben (:aroben) 2008-05-14 14:16:15 PDT
Committed in r33454