0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-12-01 17:30:59 +01:00

dont generate nonsensical code

This commit is contained in:
Rich Harris 2018-07-17 14:21:00 -04:00
parent 87e2241928
commit 980ed66c09

View File

@ -431,12 +431,11 @@ export default class Component extends Node {
${this.ref && `#component.refs.${this.ref} = ${name};`}
} else {
${name} = null;
}
${this.ref && deindent`
else if (#component.refs.${this.ref} === ${name}) {
${this.ref && deindent`
if (#component.refs.${this.ref} === ${name}) {
#component.refs.${this.ref} = null;
}`}
}
}
`);