From 6f3057ec7a612d63409a46ec0d18de0a93f67a46 Mon Sep 17 00:00:00 2001 From: Steven Orvell Date: Tue, 13 Nov 2018 16:24:53 -0800 Subject: [PATCH] Ensure property values are always overridden by extendors/behaviors --- lib/legacy/class.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/legacy/class.html b/lib/legacy/class.html index 783322c236..e416c58314 100644 --- a/lib/legacy/class.html +++ b/lib/legacy/class.html @@ -156,6 +156,12 @@ } 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 @@ 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