Bug 136690

Summary: Web Inspector: Fix ESLint* no-avoidable-bind warnings
Product: WebKit Reporter: Joseph Pecoraro <joepeck>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
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

Description Joseph Pecoraro 2014-09-09 18:13:37 PDT
I wrote an ESLint rule to catch avoidable Function.prototype.bind call with a number of built-in Array/Set/Map functional methods and it caught some issues in our code:
https://github.com/JosephPecoraro/eslint/commit/d64243a312b4e872bc3e63ccfa6ad84d2a29c675

UserInterface/Protocol/RemoteObject.js
  358:35  error  Function binding is avoidable. Use the optional thisArg argument of 'map'  no-avoidable-bind

UserInterface/Views/CSSStyleDetailsSidebarPanel.js
  47:8  error  Function binding is avoidable. Use the optional thisArg argument of 'forEach'  no-avoidable-bind

UserInterface/Views/LayerTreeSidebarPanel.js
  269:8  error  Function binding is avoidable. Use the optional thisArg argument of 'forEach'  no-avoidable-bind
  277:8  error  Function binding is avoidable. Use the optional thisArg argument of 'forEach'  no-avoidable-bind
  283:8  error  Function binding is avoidable. Use the optional thisArg argument of 'forEach'  no-avoidable-bind

UserInterface/Views/LogContentView.js
  646:8  error  Function binding is avoidable. Use the optional thisArg argument of 'forEach'  no-avoidable-bind

UserInterface/Views/TextResourceContentView.js
  90:22  error  Function binding is avoidable. Use the optional thisArg argument of 'filter'  no-avoidable-bind
Comment 1 Joseph Pecoraro 2014-09-09 18:14:25 PDT
Created attachment 237875 [details]
[PATCH] Proposed Fix
Comment 2 WebKit Commit Bot 2014-09-10 08:49:10 PDT
Comment on attachment 237875 [details]
[PATCH] Proposed Fix

Clearing flags on attachment: 237875

Committed r173462: <http://trac.webkit.org/changeset/173462>
Comment 3 WebKit Commit Bot 2014-09-10 08:49:13 PDT
All reviewed patches have been landed.  Closing bug.