Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wip] Negative startIndex in String.indexOf() #8370

Conversation

RealyUniqueName
Copy link
Member

@RealyUniqueName RealyUniqueName commented Jun 4, 2019

Closes #8365

We have targets, which don't follow this spec (quote from String.indexOf() doc):

If `startIndex` is given, the search is performed within the substring
of `this` String starting from <...> `max(this.length + startIndex, 0)` (if `startIndex` is negative).
  • neko
  • java (not jvm)
  • cs
  • lua

Also we don't have any spec about negative startIndex on String.lastIndexOf()

@RealyUniqueName RealyUniqueName added this to the Release 4.0 milestone Jun 4, 2019
@Simn Simn self-assigned this Jun 5, 2019
@Simn Simn modified the milestones: Release 4.0, Release 4.1 Jun 5, 2019
@Simn
Copy link
Member

Simn commented Jun 5, 2019

Seeing the test results this is not 4.0 priority.

@Simn Simn added the waiting-for-feedback We need more information to deal with this issue. label Feb 17, 2020
@Simn
Copy link
Member

Simn commented Feb 17, 2020

Branch needs an update.

@RealyUniqueName RealyUniqueName modified the milestones: Release 4.2, Backlog Dec 16, 2020
@Simn Simn modified the milestones: Backlog, Later Mar 24, 2023
…tartIndex

# Conflicts:
#	std/cs/internal/StringExt.hx
#	std/java/internal/StringExt.hx
@Simn
Copy link
Member

Simn commented Feb 9, 2024

The tests added here fail even on JS. Both JS and Java define a negative start index as working like 0, so if anything that's what we should conform to.

@Simn
Copy link
Member

Simn commented Feb 9, 2024

... which also means I might as well close this PR because neither the tests nor the changes bring us closer to any existing specification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-feedback We need more information to deal with this issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Test String.indexOf(s, startIndex) for negative startIndex
2 participants