tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TAP5-2370) [JavaScript][utils] startsWith method unexpected behavior.
Date Mon, 18 Aug 2014 12:53:20 GMT

    [ https://issues.apache.org/jira/browse/TAP5-2370?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14100599#comment-14100599
] 

Hudson commented on TAP5-2370:
------------------------------

FAILURE: Integrated in tapestry-trunk-freestyle #1300 (See [https://builds.apache.org/job/tapestry-trunk-freestyle/1300/])
TAP5-2370: utils.startsWith should check for the first occurrence of the pattern in the string,
not the last one (jochen.kemnade: rev b7ac7bb5acdd4f77a6916f6ddfe83f672b3c3da0)
* tapestry-core/src/test/coffeescript/org/apache/tapestry5/integration/app1/pages/test-utils.coffee
* tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/JavaScriptTests.java
* tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/utils.coffee


> [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)

Mime
View raw message