Merge pull request #2274 from jches/gh/2022

Fix weird code generation error
pull/2286/head
Rich Harris 6 years ago committed by GitHub
commit 62701f5716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -865,7 +865,7 @@ export default class Component {
} }
} else { } else {
if (node.type !== 'ExportNamedDeclaration') { if (node.type !== 'ExportNamedDeclaration') {
if (!parent) current_group = null; if (!parent || parent.type === 'Program') current_group = null;
} }
} }
}, },

@ -0,0 +1,18 @@
export default {
props: {
x: 1
},
html: `
<p>1 1 1</p>
`,
test({ assert, component, target }) {
assert.equal(component.y, 1);
assert.equal(component.z, 1);
component.x = 2;
assert.equal(component.y, 2);
assert.equal(component.z, 2);
}
};

@ -0,0 +1,10 @@
<script>
export let x, y
$: y = x;
export let z;
$: z = x;
</script>
<p>{x} {y} {z}</p>
Loading…
Cancel
Save