Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/svelte2tsx/src/svelte2tsx/utils/tsAst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export function extractIdentifiers(
} else if (ts.isShorthandPropertyAssignment(child)) {
// in ts Ast { a = 1 } and { a } are both ShorthandPropertyAssignment
extractIdentifiers(child.name, identifiers);
} else if (ts.isPropertyAssignment(child)) {
// { a: b }
extractIdentifiers(child.initializer, identifiers);
}
});
} else if (ts.isArrayLiteralExpression(node)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
///<reference types="svelte" />
<></>;function render() {

let { a } = __sveltets_1_invalidate(() => ({ a: '' }));
let { b: d } = __sveltets_1_invalidate(() => ({ b: '' }));
let { c: { length } } = __sveltets_1_invalidate(() => ({ c: '' }));
let { ...e } = __sveltets_1_invalidate(() => ({ f: ''}));
;
() => (<></>);
return { props: {}, slots: {}, getters: {}, events: {} }}

export default class Input__SvelteComponent_ extends __sveltets_1_createSvelte2TsxComponent(__sveltets_1_partial(__sveltets_1_with_any_event(render()))) {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<script>
$: ({ a } = { a: '' });
$: ({ b: d } = { b: '' });
$: ({ c: { length } } = { c: '' });
$: ({ ...e } = { f: ''});
</script>