mirror of https://github.com/sveltejs/svelte
fix: `array.lastIndexOf` without second argument (#11766)
Fixes #11756 lastIndexOf seems to be using arguments internally so passing undefined is different from not passing itpull/11768/head
parent
d946066c08
commit
d856c50092
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: support `array.lastIndexOf` without second argument
|
@ -0,0 +1,9 @@
|
|||||||
|
import { ok, test } from '../../test';
|
||||||
|
import { flushSync } from 'svelte';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['client'],
|
||||||
|
async test({ assert, logs }) {
|
||||||
|
assert.equal(logs[0], logs[1]);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
const arr = [0, 1, 2];
|
||||||
|
console.log(arr.lastIndexOf(2));
|
||||||
|
console.log(arr.lastIndexOf(2, arr.length - 1));
|
||||||
|
</script>
|
Loading…
Reference in new issue