Skip to content

Commit

Permalink
Make __currentElementProto optional for build tool
Browse files Browse the repository at this point in the history
Rename _validateMixins to _validateApplyShim
  • Loading branch information
dfreedm committed Jul 26, 2016
1 parent 498e23f commit 64d41e6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion polymer.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
this._setupShady();
this._registerHost();
if (this._template) {
this._validateMixins();
this._validateApplyShim();
// manage local dom
this._poolContent();
// host stack
Expand Down
8 changes: 6 additions & 2 deletions src/lib/apply-shim.html
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@
// NOTE: since we use mixin, the map of properties is updated here
// and this is what we want.
combinedProps = Polymer.Base.mixin(mixinEntry.properties, mixinValues);
var currentProto = ApplyShim.__currentElementProto;
var currentElementName = currentProto && currentProto.is;
for (var elementName in mixinEntry.dependants) {
if (elementName !== ApplyShim.__currentElementProto.is) {
if (elementName !== currentElementName) {
mixinEntry.dependants[elementName].__mixinsInvalid = true;
}
}
Expand Down Expand Up @@ -181,7 +183,9 @@
var mixinEntry = mapGet(mixinName);
if (mixinEntry) {
var currentProto = ApplyShim.__currentElementProto;
mixinEntry.dependants[currentProto.is] = currentProto;
if (currentProto) {
mixinEntry.dependants[currentProto.is] = currentProto;
}
var p, parts, f;
for (p in mixinEntry.properties) {
f = fallbacks && fallbacks[p];
Expand Down
2 changes: 1 addition & 1 deletion src/standard/x-styling.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
this._ownStylePropertyNames.length);
},

_validateMixins: function() {
_validateApplyShim: function() {
if (this.__mixinsInvalid) {
// rerun apply shim
Polymer.ApplyShim.transform(this._styles, this.__proto__);
Expand Down

0 comments on commit 64d41e6

Please sign in to comment.