mirror of https://github.com/sveltejs/svelte
fix: better handle $inspect on array mutations (#16389)
* fix: better handle $inspect on array mutations * increase stack trace limit, revert test change * second changeset --------- Co-authored-by: Rich Harris <rich.harris@vercel.com>pull/16384/head
parent
8e73fd4b03
commit
6cf3a19342
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: better handle $inspect on array mutations
|
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"svelte": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: leave proxied array `length` untouched when deleting properties
|
@ -0,0 +1,13 @@
|
|||||||
|
import { ok, test } from '../../test';
|
||||||
|
import { flushSync } from 'svelte';
|
||||||
|
|
||||||
|
export default test({
|
||||||
|
mode: ['client'],
|
||||||
|
async test({ target, assert, logs }) {
|
||||||
|
const btn = target.querySelector('button');
|
||||||
|
|
||||||
|
flushSync(() => btn?.click());
|
||||||
|
|
||||||
|
assert.deepEqual(logs[0], [0, , 2]);
|
||||||
|
}
|
||||||
|
});
|
@ -0,0 +1,8 @@
|
|||||||
|
<script>
|
||||||
|
const arr = [0, 1, 2];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<button onclick={() => {
|
||||||
|
delete arr[1];
|
||||||
|
console.log(arr);
|
||||||
|
}}>del</button>
|
Loading…
Reference in new issue