Ensure property values are always overridden by extendors/behaviors

This commit is contained in:
Steven Orvell
2018-11-13 16:24:53 -08:00
parent 29d514f70c
commit 6f3057ec7a
+6 -3
View File
@@ -156,6 +156,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
function mergePropertyInfo(a, b) {
if ('value' in b) {
a.value = b.value;
// ensure property value is always overridden.
} else if ('value' in a) {
delete a.value;
}
if (typeof b === 'function') {
a.type = b;
return;
@@ -163,9 +169,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
if ('type' in b) {
a.type = b.type;
}
if ('value' in b) {
a.value = b.value;
}
// readOnly: cannot become false and takes on `computed` value
a.readOnly = a.readOnly || Boolean(a.computed) || b.readOnly || Boolean(b.computed);
// computed: first in wins