Skip to content

Commit

Permalink
Undo fix on IE10 where the custom elements polyfill's mixin strategy …
Browse files Browse the repository at this point in the history
…makes this unfeasible.
  • Loading branch information
Steven Orvell committed Feb 13, 2016
1 parent d99e693 commit ef629f4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/lib/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@
var useNativeCustomElements = (!window.CustomElements ||
window.CustomElements.useNative);

var usePolyfillProto = !useNativeCustomElements && !Object.__proto__;

return {
wantShadow: wantShadow,
hasShadow: hasShadow,
nativeShadow: nativeShadow,
useShadow: useShadow,
useNativeShadow: useShadow && nativeShadow,
useNativeImports: useNativeImports,
useNativeCustomElements: useNativeCustomElements
useNativeCustomElements: useNativeCustomElements,
usePolyfillProto: usePolyfillProto
};
})()
};
Expand Down
7 changes: 5 additions & 2 deletions src/standard/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-->

<script>

(function() {
/*
Process inputs efficiently via a configure lifecycle callback.
Configure is called top-down, host before local dom. Users should
Expand Down Expand Up @@ -41,6 +41,8 @@
directly (on-foo-changed).
*/

var usePolyfillProto = Polymer.Settings.usePolyfillProto;

Polymer.Base._addFeature({

// storage for configuration
Expand Down Expand Up @@ -118,7 +120,7 @@
// 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) {
Expand Down Expand Up @@ -223,4 +225,5 @@

});

})();
</script>
4 changes: 4 additions & 0 deletions test/unit/configure.html
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
});

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
Expand Down

0 comments on commit ef629f4

Please sign in to comment.