Bug 141898 - Web Inspector: Do not show "{}" after Date description in Object Previews
Summary: Web Inspector: Do not show "{}" after Date description in Object Previews
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Joseph Pecoraro
URL:
Keywords: DoNotImportToRadar
Depends on:
Blocks:
 
Reported: 2015-02-23 01:02 PST by Joseph Pecoraro
Modified: 2015-02-24 16:32 PST (History)
7 users (show)

See Also:


Attachments
[PATCH] Proposed Fix (2.03 KB, patch)
2015-02-23 01:03 PST, Joseph Pecoraro
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 2015-02-23 01:02:13 PST
* SUMMARY
In testing, I see "{}" empty property lists after date instance preview strings. That is misleading and poor. We should just not show it.

* STEPS TO REPRODUCE
1. js> ({a: new Date})
 => expand object

* NOTES
- Requires getProperties to send back object previews, and rendering those previews
Comment 1 Joseph Pecoraro 2015-02-23 01:03:41 PST
Created attachment 247105 [details]
[PATCH] Proposed Fix
Comment 2 Timothy Hatcher 2015-02-24 14:27:42 PST
Comment on attachment 247105 [details]
[PATCH] Proposed Fix

View in context: https://bugs.webkit.org/attachment.cgi?id=247105&action=review

> Source/WebInspectorUI/ChangeLog:11
> +        Only show "{...}" section for Date objects that have user
> +        defined properties. Otherwise, Dates do not have properties.

We should consider this for RegExp too.
Comment 3 Joseph Pecoraro 2015-02-24 15:21:16 PST
(In reply to comment #2)
> Comment on attachment 247105 [details]
> [PATCH] Proposed Fix
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=247105&action=review
> 
> > Source/WebInspectorUI/ChangeLog:11
> > +        Only show "{...}" section for Date objects that have user
> > +        defined properties. Otherwise, Dates do not have properties.
> 
> We should consider this for RegExp too.

Yep, you pointed out RegExp and Error types. Those are slightly unique in that they have some base set of properties. I'll address them separately.

RegExps for instance I'm wondering if there is value in having them still be expandable, or showing preview data if "lastIndex" is non-zero. The rare cases that is being used it would be useful to see that at a glance.

Errors should just be expandable, and improve their "stack" output handling.
Comment 4 Joseph Pecoraro 2015-02-24 16:32:26 PST
http://trac.webkit.org/changeset/180592