WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
158315
Web Inspector: Modernize some function expressions that bind(this) to arrow functions
https://bugs.webkit.org/show_bug.cgi?id=158315
Summary
Web Inspector: Modernize some function expressions that bind(this) to arrow f...
Joseph Pecoraro
Reported
2016-06-02 13:44:04 PDT
* SUMMARY Modernize some function expressions that bind(this) to arrow functions The common pattern: setTimeout(function() { ... }.bind(this), delay); Can use arrow functions: setTimeout(() => { ... }, delay); Switching from bind to arrow functions has multiples benefits: - it is faster (microbenchmarks) - it uses less memory (~252bytes -> 128bytes) - the code reads better in most cases Things to be careful of: - if the inner function uses `arguments`, then converting to an arrow function won't work.
Attachments
[PATCH] Proposed Fix
(32.81 KB, patch)
2016-06-02 13:45 PDT
,
Joseph Pecoraro
no flags
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Joseph Pecoraro
Comment 1
2016-06-02 13:45:57 PDT
Created
attachment 280361
[details]
[PATCH] Proposed Fix
Blaze Burg
Comment 2
2016-06-02 14:05:48 PDT
Comment on
attachment 280361
[details]
[PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 3
2016-06-02 15:10:34 PDT
Comment on
attachment 280361
[details]
[PATCH] Proposed Fix Clearing flags on attachment: 280361 Committed
r201620
: <
http://trac.webkit.org/changeset/201620
>
WebKit Commit Bot
Comment 4
2016-06-02 15:10:37 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug