fix when LHS of a reactive assignment is a member expression (#4212)

pull/4217/head
Conduitry 5 years ago
parent fe750d2606
commit 741444d07e

@ -4,6 +4,7 @@
* Prevent text input cursor jumping in Safari with one-way binding ([#3449](https://github.com/sveltejs/svelte/issues/3449))
* Expose compiler version in dev events ([#4047](https://github.com/sveltejs/svelte/issues/4047))
* Do not automatically declare variables in reactive declarations when assigning to a member expression ([#4212](https://github.com/sveltejs/svelte/issues/4212))
## 3.16.7

@ -603,6 +603,7 @@ export default class Component {
const { expression } = node.body;
if (expression.type !== 'AssignmentExpression') return;
if (expression.left.type === 'MemberExpression') return;
extract_names(expression.left).forEach(name => {
if (!this.var_lookup.has(name) && name[0] !== '$') {

@ -0,0 +1,5 @@
export default {
test({ assert, window }) {
assert.equal(window.document.title, 'foo');
}
};
Loading…
Cancel
Save