mirror of
https://github.com/Polymer/polymer.git
synced 2026-08-19 01:14:44 -05:00
Ensure property values are always overridden by extendors/behaviors
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user