Skip to content

Commit

Permalink
Ensure property values are always overridden by extendors/behaviors
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Orvell committed Nov 14, 2018
1 parent 29d514f commit 6f3057e
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/legacy/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,19 @@
}

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;
}
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
Expand Down

0 comments on commit 6f3057e

Please sign in to comment.