Bug 28666 - Inspector: REGRESSION Formatting Function in Console is Abbreviated Too Often
Summary: Inspector: REGRESSION Formatting Function in Console is Abbreviated Too Often
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: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-23 00:25 PDT by Joseph Pecoraro
Modified: 2009-08-23 12:51 PDT (History)
4 users (show)

See Also:


Attachments
patch (2.23 KB, patch)
2009-08-23 02:41 PDT, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Pecoraro 2009-08-23 00:25:17 PDT
Current Behavior:

> Math.sin
function sin() {
> var o = { a: Math.sin }
undefined
> o
Object
  a: function sin() {
> o.a
function sin() {


Expected Behavior: (From Safari 4.0.3)

> Math.sin
function sin() {
    [native code]
}
> var o = { a: Math.sin }
undefined
> o
Object
  a: function sin() {
> o.a
function sin() {
    [native code]
}


The current behavior abbreviates too often (in fact all the time).  Specifically when setting the "description" in InjectedScript.createProxyObject.  Changing the Object.describe() call inside createProxyObject makes all of the examples above the unabbreviated style.  Should abbreviation move out of Object.describe() and instead be used right before showing in the UI?
Comment 1 Pavel Feldman 2009-08-23 02:18:51 PDT
(In reply to comment #0)

> The current behavior abbreviates too often (in fact all the time). 
> Specifically when setting the "description" in
> InjectedScript.createProxyObject.  Changing the Object.describe() call inside
> createProxyObject makes all of the examples above the unabbreviated style. 
> Should abbreviation move out of Object.describe() and instead be used right
> before showing in the UI?

Thanks for reporting this. Passing information from the InjectedScript to the UI is going to be slow, especially after we add the JSON serialization there. So we don't want to push information that might not be needed for the UI. I think I just need to find the place where it got regressed and do no abbreviation there. Or do you want to investigate it?
Comment 2 Pavel Feldman 2009-08-23 02:41:02 PDT
Created attachment 38451 [details]
patch
Comment 3 Joseph Pecoraro 2009-08-23 07:48:44 PDT
This is the exact idea I thought of after I left this last night. Short and sweet.
Comment 4 Pavel Feldman 2009-08-23 12:51:14 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/front-end/InjectedScript.js
Committed r47695