Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Feb 2018 03:05:54 +0000 (03:05 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Feb 2018 03:05:54 +0000 (03:05 +0000)
commitfd8f79d25c31c89306df3382791c5c0b982925e2
treeb283003d760d885118434f53c9f7f9e8afde5dc2
parente3ac061dc10f649780a99e8924ba7c5202cfad90
Web Inspector: Rename String.prototype.trimEnd to avoid conflicts with native trimEnd
https://bugs.webkit.org/show_bug.cgi?id=182545

Reviewed by Brian Burg.

Source/WebInspectorUI:

Rename:
- trimEnd to truncateEnd
- trimMiddle to truncateMiddle

* UserInterface/Base/Utilities.js:
(String.prototype.trimMiddle): Deleted.
(String.prototype.trimEnd): Deleted.
(String.prototype.truncateMiddle): Added.
(String.prototype.truncateEnd): Added.
Use strict mode. Scrict mode allows `this` to be a primitive (a string, in our case).
In non-strict mode, `this` is always an object. Without the strict mode,
"a".truncateEnd(42) !== "a", because truncateEnd returns a string object.

* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._buildAttributeDOM):
* UserInterface/Views/DOMTreeElementPathComponent.js:
(WI.DOMTreeElementPathComponent):
* UserInterface/Views/SearchResultTreeElement.js:
Remove an obvious comment.

(WI.SearchResultTreeElement.truncateAndHighlightTitle):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._renderValue):

LayoutTests:

* inspector/unit-tests/string-utilities-expected.txt:
* inspector/unit-tests/string-utilities.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/inspector/unit-tests/string-utilities-expected.txt
LayoutTests/inspector/unit-tests/string-utilities.html
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Base/Utilities.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElement.js
Source/WebInspectorUI/UserInterface/Views/DOMTreeElementPathComponent.js
Source/WebInspectorUI/UserInterface/Views/SearchResultTreeElement.js
Source/WebInspectorUI/UserInterface/Views/SpreadsheetStyleProperty.js