RESOLVED FIXED 182545
Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd
https://bugs.webkit.org/show_bug.cgi?id=182545
Summary Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native...
Nikita Vasilyev
Reported 2018-02-06 11:53:06 PST
trimEnd just landed in JSC (bug 182233). Just like `trim` removes whitespace at the beginning and the end of a string, trimEnd removes whitespace only at the end. In Utilities.js we have: String.prototype.trimEnd(maxLength) String.prototype.trimMiddle(maxLength) String.prototype.truncate(maxLength) Our trimEnd truncates a string to a specified maxLength. I suggest to rename: 1. trimEnd to truncateEnd 2. trimMiddle to truncateMiddle
Attachments
Patch (9.67 KB, patch)
2018-02-06 16:38 PST, Nikita Vasilyev
no flags
Blaze Burg
Comment 1 2018-02-06 14:43:39 PST
(In reply to Nikita Vasilyev from comment #0) > trimEnd just landed in JSC (bug 182233). Just like `trim` removes whitespace > at the beginning and the end of a string, > trimEnd removes whitespace only at the end. > > In Utilities.js we have: > > String.prototype.trimEnd(maxLength) > String.prototype.trimMiddle(maxLength) > String.prototype.truncate(maxLength) > > Our trimEnd truncates a string to a specified maxLength. > > I suggest to rename: > 1. trimEnd to truncateEnd > 2. trimMiddle to truncateMiddle Sounds okay to me.
Nikita Vasilyev
Comment 2 2018-02-06 16:38:42 PST
Blaze Burg
Comment 3 2018-02-06 16:59:18 PST
Comment on attachment 333235 [details] Patch r=me with EWS
WebKit Commit Bot
Comment 4 2018-02-06 19:05:59 PST
Comment on attachment 333235 [details] Patch Clearing flags on attachment: 333235 Committed r228214: <https://trac.webkit.org/changeset/228214>
WebKit Commit Bot
Comment 5 2018-02-06 19:06:00 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2018-02-06 19:08:23 PST
Note You need to log in before you can comment on or make changes to this bug.