diff --git a/src/compile/utils/scope.ts b/src/compile/utils/scope.ts index 20cca46cba3e..6488986d83ae 100644 --- a/src/compile/utils/scope.ts +++ b/src/compile/utils/scope.ts @@ -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 { diff --git a/test/runtime/samples/dev-warning-missing-data-binding/main.svelte b/test/runtime/samples/dev-warning-missing-data-binding/main.svelte index 3714351783f8..cfc7830c9048 100644 --- a/test/runtime/samples/dev-warning-missing-data-binding/main.svelte +++ b/test/runtime/samples/dev-warning-missing-data-binding/main.svelte @@ -1,5 +1,6 @@ \ No newline at end of file diff --git a/test/runtime/samples/dev-warning-missing-data-component/Foo.svelte b/test/runtime/samples/dev-warning-missing-data-component/Foo.svelte index 95422444ccbe..99e26245ae3d 100644 --- a/test/runtime/samples/dev-warning-missing-data-component/Foo.svelte +++ b/test/runtime/samples/dev-warning-missing-data-component/Foo.svelte @@ -1,6 +1,7 @@