Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2370

[JavaScript][utils] startsWith method unexpected behavior.

    Details

      Description

      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.

        Attachments

          Activity

            People

            • Assignee:
              jkemnade Jochen Kemnade
              Reporter:
              Charlouze Charles Capon
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: