Merge pull request #2637 from sveltejs/gh-2635

Fix determining which props need a value in dev mode
pull/2670/head
Rich Harris 5 years ago committed by GitHub
commit 73bf5829f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -75,12 +75,10 @@ export class Scope {
if (node.kind === 'var' && this.block && this.parent) {
this.parent.add_declaration(node);
} else if (node.type === 'VariableDeclaration') {
const initialised = !!node.init;
node.declarations.forEach((declarator: Node) => {
extract_names(declarator.id).forEach(name => {
this.declarations.set(name, node);
if (initialised) this.initialised_declarations.add(name);
if (declarator.init) this.initialised_declarations.add(name);
});
});
} else {

@ -1,5 +1,6 @@
<script>
export let value;
export let value_with_default = undefined;
</script>
<input bind:value>

@ -1,6 +1,7 @@
<script>
export let x;
export let y;
export let z = undefined;
</script>
<div>{x} {y}</div>
Loading…
Cancel
Save