Skip to content

Commit f2a12cb

Browse files
committed
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`.
1 parent a68c0b3 commit f2a12cb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/standard/configure.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@
4343

4444
var usePolyfillProto = Polymer.Settings.usePolyfillProto;
4545

46+
// When true, `this.properties` is bad juju due to obsolete `properties`
47+
// accessors on instances of HTMLElement
48+
var avoidInstanceProperties =
49+
Boolean(Object.getOwnPropertyDescriptor(document.body, 'properties'));
50+
4651
Polymer.Base._addFeature({
4752

4853
// storage for configuration
@@ -106,7 +111,8 @@
106111
// property, and b.) the `properties` accessor is on instances rather
107112
// than `HTMLElement.prototype`; going under the instance to the prototype
108113
// avoids the problem.
109-
this._configureProperties(this.__proto__.properties, config);
114+
this._configureProperties(avoidInstanceProperties ?
115+
this.__proto__.properties : this.properties, config);
110116
// TODO(sorvell): it *may* be faster to loop over _propertyInfo but
111117
// there are some test issues.
112118
//this._configureProperties(this._propertyInfo, config);

0 commit comments

Comments
 (0)