Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #7822 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] String.starts/endsWith bug

Reported by: ei99070 Assigned to: sam
Priority: normal Milestone: 1.x
Component: Prototype Version: edge
Severity: minor Keywords: 1.5.1 ready
Cc:

Description

I think this piece of code is self explanatory! :)

var s = 'foo';

alert(s.startsWith('fo')); //true -> right
alert(s.startsWith('foo')); //true -> right
alert(s.startsWith('fooo')); //true -> wrong!!!

Attachments

string-start-end.patch (1.2 kB) - added by altblue on 03/14/07 22:39:41.
tests + fix for endsWith

Change History

03/14/07 22:39:41 changed by altblue

  • attachment string-start-end.patch added.

tests + fix for endsWith

03/14/07 22:47:05 changed by altblue

the reason for my previous patch was that even if startsWith seem to already being fixed, an analogous test for endsWith still fails:

'foo'.endsWith('xfoo'); // true

03/20/07 11:34:48 changed by mislav

  • keywords set to ready.
  • severity changed from normal to minor.
  • summary changed from String.startsWith error! to [PATCH] String.starts/endsWith bug.

Thanks! I guess we didn't see this coming

03/24/07 06:48:56 changed by Tobie

  • keywords changed from ready to 1.5.1 ready.

03/27/07 17:44:04 changed by madrobby

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in [6473].