Skip to content

Commit

Permalink
get behaviors only from prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
valdrinkoshi committed Mar 9, 2017
1 parent 444c043 commit 8bac5c6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/legacy/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@
if (!Array.isArray(behaviors)) {
behaviors = [behaviors];
}
let superBehaviors = klass.behaviors;
let superBehaviors = klass.prototype.behaviors;
// get flattened, deduped list of behaviors *not* already on super class
behaviors = flattenBehaviors(behaviors, null, superBehaviors);
// mixin new behaviors
klass = _mixinBehaviors(behaviors, klass);
if (superBehaviors) {
behaviors = superBehaviors.concat(behaviors);
}
// Set behaviors on the prototype to be compatible with 1.x
klass.prototype.behaviors = behaviors;
return klass;
}
Expand Down Expand Up @@ -320,8 +321,6 @@
LegacyElementMixin(HTMLElement));
// decorate klass with registration info
klass.is = info.is;
// behaviors on prototype for BC...
klass.prototype.behaviors = klass.behaviors;
// NOTE: while we could call `beforeRegister` here to maintain
// some BC, the state of the element at this point is not as it was in 1.0
// In 1.0, the method was called *after* mixing prototypes together
Expand Down

0 comments on commit 8bac5c6

Please sign in to comment.