Merge pull request #3408 from Polymer/3063-kschaaf-extend-template

Ensure _propertySetter is installed first. Fixes #3063
This commit is contained in:
Steve Orvell 2016-02-12 19:18:56 -08:00
commit 55876ca2cf

View File

@ -298,6 +298,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// values (_propertySetter back on instance once accessor is installed)
_extendTemplate: function(template, proto) {
var n$ = Object.getOwnPropertyNames(proto);
if (proto._propertySetter) {
// _propertySetter API may need to be copied onto the template,
// and it needs to come first to allow the property swizzle below
template._propertySetter = proto._propertySetter;
}
for (var i=0, n; (i<n$.length) && (n=n$[i]); i++) {
var val = template[n];
var pd = Object.getOwnPropertyDescriptor(proto, n);