From f2a12cb1c60d35abc355ea9ae9b066d1e0756035 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Thu, 16 Feb 2017 18:22:56 -0800 Subject: [PATCH] Fix test failures by feature detecting instance `properties` accessors. Can't rely on `__proto__` on IE10, but that browser doesn't need to avoid `properties`. --- src/standard/configure.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/standard/configure.html b/src/standard/configure.html index 0f910ebb75..91a1319ce1 100644 --- a/src/standard/configure.html +++ b/src/standard/configure.html @@ -43,6 +43,11 @@ var usePolyfillProto = Polymer.Settings.usePolyfillProto; + // When true, `this.properties` is bad juju due to obsolete `properties` + // accessors on instances of HTMLElement + var avoidInstanceProperties = + Boolean(Object.getOwnPropertyDescriptor(document.body, 'properties')); + Polymer.Base._addFeature({ // storage for configuration @@ -106,7 +111,8 @@ // property, and b.) the `properties` accessor is on instances rather // than `HTMLElement.prototype`; going under the instance to the prototype // avoids the problem. - this._configureProperties(this.__proto__.properties, config); + this._configureProperties(avoidInstanceProperties ? + this.__proto__.properties : this.properties, config); // TODO(sorvell): it *may* be faster to loop over _propertyInfo but // there are some test issues. //this._configureProperties(this._propertyInfo, config);