You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Jochen Kemnade (JIRA)" <ji...@apache.org> on 2014/08/18 13:05:18 UTC
[jira] [Closed] (TAP5-2370) [JavaScript][utils] startsWith method
unexpected behavior.
[ https://issues.apache.org/jira/browse/TAP5-2370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jochen Kemnade closed TAP5-2370.
--------------------------------
Resolution: Fixed
Fix Version/s: 5.4
> [JavaScript][utils] startsWith method unexpected behavior.
> ----------------------------------------------------------
>
> Key: TAP5-2370
> URL: https://issues.apache.org/jira/browse/TAP5-2370
> Project: Tapestry 5
> Issue Type: Bug
> Components: tapestry-core
> Affects Versions: 5.4
> Reporter: Charles Capon
> Assignee: Jochen Kemnade
> Priority: Minor
> Labels: javascript, utils
> Fix For: 5.4
>
>
> I found that the _startsWith_ method that can be found in the _utils_ module has unexpected behavior. It works well for most cases except when your pattern is repeated on or more times in your string :
> * string: foobar - pattern: foo -> true
> * string: foobarfoo - pattern: foo -> false
> It's because _string.lastIndexOf_ is use instead of _indexOf_.
--
This message was sent by Atlassian JIRA
(v6.2#6252)