Undo fix on IE10 where the custom elements polyfill's mixin strategy makes this unfeasible.

This commit is contained in:
Steven Orvell 2016-02-12 18:39:48 -08:00
parent d99e6939d6
commit ef629f4c4b
3 changed files with 13 additions and 3 deletions

View File

@ -38,6 +38,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var useNativeCustomElements = (!window.CustomElements ||
window.CustomElements.useNative);
var usePolyfillProto = !useNativeCustomElements && !Object.__proto__;
return {
wantShadow: wantShadow,
hasShadow: hasShadow,
@ -45,7 +47,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
useShadow: useShadow,
useNativeShadow: useShadow && nativeShadow,
useNativeImports: useNativeImports,
useNativeCustomElements: useNativeCustomElements
useNativeCustomElements: useNativeCustomElements,
usePolyfillProto: usePolyfillProto
};
})()
};

View File

@ -9,7 +9,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
-->
<script>
(function() {
/*
Process inputs efficiently via a configure lifecycle callback.
Configure is called top-down, host before local dom. Users should
@ -41,6 +41,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
directly (on-foo-changed).
*/
var usePolyfillProto = Polymer.Settings.usePolyfillProto;
Polymer.Base._addFeature({
// storage for configuration
@ -118,7 +120,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
// to override default values. This allows late upgrade + an early set
// to not b0rk accessors on the prototype.
// Perf testing has shown `hasOwnProperty` to be ok here.
if (this.hasOwnProperty(i)) {
if (!usePolyfillProto && this.hasOwnProperty(i)) {
config[i] = this[i];
delete this[i];
} else if (c.value !== undefined) {
@ -223,4 +225,5 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
})();
</script>

View File

@ -104,6 +104,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
test('pre-register property assignment does not break getters and setters', function() {
// don't test if __proto__ is polyfilled (IE10); cannot be fixed in this case.
if (Polymer.Settings.usePolyfillProto) {
return;
}
var x = document.createElement('x-late-register');
document.body.appendChild(x);
// set property