Add undefined check for computed properties

Same as obervers, in polymer 2 a computed property will run when
at least one dependencies is defined. To match the behavior in v1,
return undefined if not all dependencies are defined.

Bug: Issue 10723
Change-Id: Iaa294d5bc392c6f3970cdbb59213a9d2913e6f64
This commit is contained in:
Tao Zhou
2019-08-12 18:53:02 +02:00
parent 57bce3c662
commit d2fca29792
31 changed files with 390 additions and 40 deletions

View File

@@ -133,6 +133,11 @@
},
_computeDescriptionReadOnly(loggedIn, change, account) {
// Polymer 2: check for undefined
if ([loggedIn, change, account].some(arg => arg === undefined)) {
return undefined;
}
return !(loggedIn && (account._account_id === change.owner._account_id));
},