Bug 137152

Summary: Web Inspector: Type Token View shows type information on hover when it shouldn't
Product: WebKit Reporter: Saam Barati <saam>
Component: Web InspectorAssignee: Saam Barati <saam>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, timothy, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
patch burg: review+

Description Saam Barati 2014-09-26 10:56:49 PDT
TypeTokenView::_shouldShowPopover is broken:

One of its conditions reads: 
if (this._types.structures && this._types.structures) { ... }

But it should be written as:
if (this._types.structures && this._types.structures.length > 1) { ... }
Comment 1 Radar WebKit Bug Importer 2014-09-26 10:57:02 PDT
<rdar://problem/18470483>
Comment 2 Saam Barati 2014-09-26 14:16:47 PDT
(In reply to comment #0)
> TypeTokenView::_shouldShowPopover is broken:
> 
> One of its conditions reads: 
> if (this._types.structures && this._types.structures) { ... }
> 
> But it should be written as:
> if (this._types.structures && this._types.structures.length > 1) { ... }
This should actually be:
 if (this._types.structures && this._types.structures.length >= 1) { ... }
because we care if there is only one object or more, not more than one.
Comment 3 Saam Barati 2014-09-26 14:22:19 PDT
Created attachment 238737 [details]
patch
Comment 4 Brian Burg 2014-09-26 14:25:16 PDT
Comment on attachment 238737 [details]
patch

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

> Source/WebInspectorUI/UserInterface/Views/TypeTokenView.js:135
> +        if (this._types.structures && this._types.structures.length >= 1)

I think you can drop the >= 1 here.
Comment 5 Saam Barati 2014-09-26 14:40:31 PDT
landed in: http://trac.webkit.org/changeset/174019