We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The introduction of equality.js in #11610 seems to have broken the behaviour of lastIndexOf() from 5.0.0-next.134 onwards.
lastIndexOf()
Specifically, from v134 omitting the second argument (fromIndex) seems to default as 0 / falsy rather than the last index of the array.
const arr = [0, 1, 2]; console.log('Without fromIndex:', arr.lastIndexOf(2)); console.log('With fromIndex:', arr.lastIndexOf(2, arr.length - 1));
Before:
Without fromIndex: 2 With fromIndex: 2
After:
Without fromIndex: -1 With fromIndex: 2
Thanks for all the hard work on this. Looking forward to the final release.
As above.
No response
System: OS: macOS 11.7.10 CPU: (4) x64 Intel(R) Core(TM) M-5Y71 CPU @ 1.20GHz Memory: 49.04 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 20.3.0 - /usr/local/bin/node npm: 9.6.7 - /usr/local/bin/npm Browsers: Chrome: 124.0.6367.210 Safari: 16.6.1 npmPackages: svelte: ^5.0.0-next.134 => 5.0.0-next.134
blocking all usage of svelte
The text was updated successfully, but these errors were encountered:
array.lastIndexOf
fix: array.lastIndexOf without second argument (#11766)
d856c50
Fixes #11756 lastIndexOf seems to be using arguments internally so passing undefined is different from not passing it
Successfully merging a pull request may close this issue.
Describe the bug
The introduction of equality.js in #11610 seems to have broken the behaviour of
lastIndexOf()
from 5.0.0-next.134 onwards.Specifically, from v134 omitting the second argument (fromIndex) seems to default as 0 / falsy rather than the last index of the array.
Before:
After:
Thanks for all the hard work on this. Looking forward to the final release.
Reproduction
As above.
Logs
No response
System Info
System: OS: macOS 11.7.10 CPU: (4) x64 Intel(R) Core(TM) M-5Y71 CPU @ 1.20GHz Memory: 49.04 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 20.3.0 - /usr/local/bin/node npm: 9.6.7 - /usr/local/bin/npm Browsers: Chrome: 124.0.6367.210 Safari: 16.6.1 npmPackages: svelte: ^5.0.0-next.134 => 5.0.0-next.134
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: