diff --git a/lib/legacy/class.html b/lib/legacy/class.html index 873b76c5e3..7506d2367b 100644 --- a/lib/legacy/class.html +++ b/lib/legacy/class.html @@ -54,7 +54,7 @@ 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 @@ -62,6 +62,7 @@ if (superBehaviors) { behaviors = superBehaviors.concat(behaviors); } + // Set behaviors on the prototype to be compatible with 1.x klass.prototype.behaviors = behaviors; return klass; } @@ -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