The Wayback Machine - https://web.archive.org/web/20201220221214/https://github.com/lodash/lodash/pull/4410
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

Coerce indexOf fromIndex parameter to integer using toInteger #4410

Merged
merged 1 commit into from Aug 16, 2019

Conversation

@blikblum
Copy link
Contributor

@blikblum blikblum commented Aug 16, 2019

Uses toInteger instead of plus sign to coerce fromIndex parameter in indexOf.

This fixes use cases like indexOf([1, 2, 1, 2], 2, 2.1)

@blikblum
Copy link
Contributor Author

@blikblum blikblum commented Aug 16, 2019

Here is a test case from v4 covering this issue: https://github.com/lodash/lodash/blob/4.17.5-post/test/test.js#L6247

@jdalton jdalton added the bug label Aug 16, 2019
@jdalton
Copy link
Member

@jdalton jdalton commented Aug 16, 2019

Thank you again and again @blikblum!

@jdalton jdalton merged commit ff4949b into lodash:master Aug 16, 2019
1 check passed
1 check passed
licence/cla Contributor License Agreement is signed.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.