mirror of https://github.com/sveltejs/svelte
fix: handle patterns in destructured literals (#8871)
fixes #8863 --------- Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>pull/8957/head
parent
258ccf204b
commit
20dac2ae12
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: handle destructured primitive literals
|
@ -0,0 +1,6 @@
|
|||||||
|
import { readFileSync } from 'node:fs';
|
||||||
|
import { compile } from '../svelte/src/compiler/index.js';
|
||||||
|
|
||||||
|
const code = readFileSync('src/App.svelte', 'utf8');
|
||||||
|
|
||||||
|
console.log(compile(code));
|
@ -1,6 +1,7 @@
|
|||||||
<script>
|
<script>
|
||||||
const ANSWER = 42;
|
const ANSWER = 42;
|
||||||
|
const { length } = 'abc';
|
||||||
function get_answer() { return ANSWER; }
|
function get_answer() { return ANSWER; }
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<b>{get_answer()}</b>
|
<b>{get_answer()} {length}</b>
|
Loading…
Reference in new issue