Check 'injected' and 'fixed_reactive_declarations' independently

pull/2631/head
Emil Tholin 5 years ago
parent d419274afd
commit 0e0da70917

@ -423,14 +423,15 @@ export default function dom(
${set && `$$self.$set = ${set};`}
${reactive_declarations.length > 0 && deindent`
${injected.length && `let ${injected.join(', ')};`}
${reactive_declarations.length > 0 && deindent`
$$self.$$.update = ($$dirty = { ${Array.from(all_reactive_dependencies).map(n => `${n}: 1`).join(', ')} }) => {
${reactive_declarations}
};
`}
${fixed_reactive_declarations}
`}
return ${stringify_props(filtered_declarations)};
}

@ -0,0 +1,11 @@
export default {
html: `
<p>4</p>
`,
test({ assert, component, target }) {
assert.htmlEqual(target.innerHTML, `
<p>4</p>
`);
}
};

@ -0,0 +1,6 @@
<script>
const num = 2;
$: squared = num * num;
</script>
<p>{squared}</p>
Loading…
Cancel
Save