Bug 137152 - Web Inspector: Type Token View shows type information on hover when it shouldn't
Summary: Web Inspector: Type Token View shows type information on hover when it shouldn't
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: Saam Barati
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-09-26 10:56 PDT by Saam Barati
Modified: 2014-09-26 14:40 PDT (History)
4 users (show)

See Also:


Attachments
patch (1.53 KB, patch)
2014-09-26 14:22 PDT, Saam Barati
burg: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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