Skip to content

Object destructuring in @const #164

@janosh

Description

@janosh

False positive undefined variables when destructuring object keys in @const tag:

Screen Shot 2022-01-30 at 20 23 58

Minimal REPL

<script>
	const objs = [{a:1, b:2}, {a:3, b:4}]
</script>

{#each objs as obj}
	{@const {a, b} = obj}
	{a} {b}
{/each}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions