You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Charles Capon (JIRA)" <ji...@apache.org> on 2014/08/07 19:48:11 UTC

[jira] [Created] (TAP5-2370) [JavaScript][utils] startsWith method unexpected behavior.

Charles Capon created TAP5-2370:
-----------------------------------

             Summary: [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
            Priority: Minor


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)