update snapshot tests

pull/856/head
Rich Harris 7 years ago
parent 6f0961ed5a
commit 4d6e95d799

@ -156,7 +156,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -132,7 +132,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);
@ -194,7 +194,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._recompute({}, this._state, {}, true);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this._state, this);
@ -206,10 +206,10 @@ function SvelteComponent(options) {
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state, oldState, isInitial) {
if (isInitial || changed.x) {
if (differs((state.a = template.computed.a(state.x)), oldState.a)) changed.a = true;
if (differs((state.b = template.computed.b(state.x)), oldState.b)) changed.b = true;
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true;
}
};

@ -29,7 +29,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
this._recompute({}, this._state, {}, true);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this._state, this);
@ -41,10 +41,10 @@ function SvelteComponent(options) {
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state, oldState, isInitial) {
if (isInitial || changed.x) {
if (differs((state.a = template.computed.a(state.x)), oldState.a)) changed.a = true;
if (differs((state.b = template.computed.b(state.x)), oldState.b)) changed.b = true;
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (differs(state.a, (state.a = template.computed.a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = template.computed.b(state.x)))) changed.b = true;
}
}

@ -152,7 +152,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -152,7 +152,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -165,7 +165,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -152,7 +152,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -156,7 +156,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -156,7 +156,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -148,7 +148,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -148,7 +148,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -148,7 +148,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -148,7 +148,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -152,7 +152,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -150,7 +150,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -167,7 +167,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -160,7 +160,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -146,7 +146,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -132,7 +132,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -132,7 +132,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

@ -156,7 +156,7 @@ function _set(newState) {
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state, oldState, false);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.update(changed, this._state);

Loading…
Cancel
Save