Re: Bug: String.prototype.endsWith

2011-10-07 Thread David Herman
Fixed, thanks. Dave, digging his way out of a massive backlog... On Sep 23, 2011, at 12:18 PM, Axel Rauschmayer wrote: http://wiki.ecmascript.org/doku.php?id=harmony:string_extras I’ve found a small bug: String.prototype.endsWith = function(s) { var t = String(s); return

Bug: String.prototype.endsWith

2011-09-23 Thread Axel Rauschmayer
http://wiki.ecmascript.org/doku.php?id=harmony:string_extras I’ve found a small bug: String.prototype.endsWith = function(s) { var t = String(s); return this.lastIndexOf(t) === this.length - t.length; }; Interaction: .endsWith(/) true #.endsWith(//) true ##.endsWith(///) true Fix (e.g

Re: Bug: String.prototype.endsWith

2011-09-23 Thread Xavier MONTILLET
://wiki.ecmascript.org/doku.php?id=harmony:string_extras I’ve found a small bug: String.prototype.endsWith = function(s) {    var t = String(s);    return this.lastIndexOf(t) === this.length - t.length; }; Interaction: .endsWith(/) true #.endsWith(//) true ##.endsWith(///) true Fix (e.g

Re: Bug: String.prototype.endsWith

2011-09-23 Thread Rick Waldron
- s.length ) === String(s); }; ? I mean lastIndexOf must be much slower... On Fri, Sep 23, 2011 at 9:18 PM, Axel Rauschmayer a...@rauschma.de wrote: http://wiki.ecmascript.org/doku.php?id=harmony:string_extras I’ve found a small bug: String.prototype.endsWith = function(s

Re: Bug: String.prototype.endsWith

2011-09-23 Thread Rick Waldron
wrote: http://wiki.ecmascript.org/doku.php?id=harmony:string_extras I’ve found a small bug: String.prototype.endsWith = function(s) { var t = String(s); return this.lastIndexOf(t) === this.length - t.length; }; Interaction: .endsWith(/) true #.endsWith(//) true