Bug 136682

Summary: Web Inspector: Fix ESLint consistent-return warnings
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Joseph Pecoraro <joepeck>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, graouts, joepeck, jonowells, timothy, webkit-bug-importer
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
[PATCH] Proposed Fix
none
[PATCH] Proposed Fix none

Description Joseph Pecoraro 2014-09-09 15:10:29 PDT
This warning warns about inconsistent use of "return x" and "return" within a function.

This fixes all but CodeMirrorCompletionController.js warning which have key handlers that either bail or return CodeMirror.Pass.
Comment 1 Joseph Pecoraro 2014-09-09 15:11:46 PDT
Created attachment 237861 [details]
[PATCH] Proposed Fix
Comment 2 Joseph Pecoraro 2014-09-09 15:13:41 PDT
Created attachment 237863 [details]
[PATCH] Proposed Fix

Better fix, includes the change to the eslintrc file.
Comment 3 Timothy Hatcher 2014-09-10 08:16:18 PDT
Comment on attachment 237863 [details]
[PATCH] Proposed Fix

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

> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:-389
>          console.assert(!this._waitingForMainFrameResourceTreePayload);
> -        if (this._waitingForMainFrameResourceTreePayload)
> -            return;

Why isn't the early return needed still? It would be bad to continue here.
Comment 4 Joseph Pecoraro 2014-09-10 11:39:35 PDT
Comment on attachment 237863 [details]
[PATCH] Proposed Fix

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

>> Source/WebInspectorUI/UserInterface/Controllers/FrameResourceManager.js:-389
>> -            return;
> 
> Why isn't the early return needed still? It would be bad to continue here.

Checking all the callers, this should never be reached if this._waitingForMainFrameResourceTreePayload. So rather then return null which could throw an exception earlier on, I just left the assert.
Comment 5 WebKit Commit Bot 2014-09-10 12:15:43 PDT
Comment on attachment 237863 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 237863

Committed r173477: <http://trac.webkit.org/changeset/173477>
Comment 6 WebKit Commit Bot 2014-09-10 12:15:47 PDT
All reviewed patches have been landed.  Closing bug.