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.
This is actually a bug in the inspector
This affects logging any object. Try console.log({}) and it gives undefined.
Created attachment 21136 [details] patch v1 with ChangeLog
Committed in r33454