Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure that throwing an exception in an observer does not leave the PropertiesChanged mixin in an invalid state #5687

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Make sure that throwing an exception in an observer does not leave th…
…e PropertiesChanged mixin in an invalid state
  • Loading branch information
balint777 committed May 13, 2021
commit 0d057e207271bd82546eddd6376db4d7ff414a1d
21 changes: 12 additions & 9 deletions lib/mixins/properties-changed.js
Original file line number Diff line number Diff line change
@@ -374,16 +374,19 @@ export const PropertiesChanged = dedupingMixin(
* @override
*/
_flushProperties() {
this.__dataCounter++;
const props = this.__data;
const changedProps = this.__dataPending;
const old = this.__dataOld;
if (this._shouldPropertiesChange(props, changedProps, old)) {
this.__dataPending = null;
this.__dataOld = null;
this._propertiesChanged(props, changedProps, old);
try {
this.__dataCounter++;
const props = this.__data;
const changedProps = this.__dataPending;
const old = this.__dataOld;
if (this._shouldPropertiesChange(props, changedProps, old)) {
this.__dataPending = null;
this.__dataOld = null;
this._propertiesChanged(props, changedProps, old);
}
} finally {
this.__dataCounter--;
}
this.__dataCounter--;
}

/**