Skip to content

Commit

Permalink
Merge pull request #2637 from sveltejs/gh-2635
Browse files Browse the repository at this point in the history
Fix determining which props need a value in dev mode
  • Loading branch information
Rich-Harris authored May 4, 2019
2 parents 7b99299 + 8bfb5b7 commit 73bf582
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/compile/utils/scope.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script>
export let value;
export let value_with_default = undefined;
</script>

<input bind:value>
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script>
export let x;
export let y;
export let z = undefined;
</script>

<div>{x} {y}</div>

0 comments on commit 73bf582

Please sign in to comment.