From 8bac5c6091dfd4f167bec82b2725ae993de460c3 Mon Sep 17 00:00:00 2001 From: valdrinkoshi Date: Wed, 8 Mar 2017 17:48:12 -0800 Subject: [PATCH] get behaviors only from prototypes --- lib/legacy/class.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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