mirror of https://github.com/sveltejs/svelte
fix: do not spread non-enumerable symbols (#17097)
parent
8ebbb3c7bc
commit
b7625fd42c
@ -1,5 +1,5 @@
|
|||||||
import { test } from '../../test';
|
import { test } from '../../test';
|
||||||
|
|
||||||
export default test({
|
export default test({
|
||||||
html: `<p>42</p>`
|
html: `<p>true false</p>`
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1,8 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
const symbol = Symbol();
|
const symbol1 = Symbol();
|
||||||
|
const symbol2 = Symbol();
|
||||||
|
|
||||||
|
let a = { [symbol1]: 42 };
|
||||||
|
Object.defineProperty(a, symbol2, { enumerable: false, value: "nope" })
|
||||||
|
|
||||||
let a = { [symbol]: 42 };
|
|
||||||
let { ...b } = $derived(a);
|
let { ...b } = $derived(a);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<p>{b[symbol]}</p>
|
<p>{symbol1 in b} {symbol2 in b}</p>
|
||||||
|
|||||||
Loading…
Reference in new issue