Bug 28666

Summary: Inspector: REGRESSION Formatting Function in Console is Abbreviated Too Often
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web Inspector (Deprecated)Assignee: Pavel Feldman <pfeldman>
Status: RESOLVED FIXED    
Severity: Normal CC: aroben, joepeck, pfeldman, timothy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch timothy: review+

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