DevTools: remove illusionary caching from String.prototype.lineEndings
The String.prototype.lineEndings pretended to cache the lineEndings value
on the instance of String object. However, it turned out to be working
only for string objects, and not for the string primitives.
For example, consider the following code snippet:
var a = "foo";
a.lineEndings(); // caching failed
var b = new String(a);
b.lineEndings(); // caching successful
var c = b.substring(0);
c.lineEndings(); // caching failed
The patch removes the caching from String.prototype.lineEndings(). Instead, it introduces
WI.Text object, which wraps String, caches lineEndings
properly, and provides some other handy methods.
BUG=none
R=dgozman, pfeldman
Committed:
https://crrev.com/838e5ce388c673a1ae71ad411e7ea88be740619c
Cr-Commit-Position: refs/heads/master@{#381620}