From d93cbfa5aa1fd06d0d1d8243ee1070559b7fca02 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Tue, 28 Aug 2018 10:28:46 -0700 Subject: [PATCH] Add comments re: need for mixing in before metaprogramming --- lib/legacy/class.js | 1 + lib/legacy/legacy-data-mixin.js | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lib/legacy/class.js b/lib/legacy/class.js index 1d0e336573..9201283e09 100644 --- a/lib/legacy/class.js +++ b/lib/legacy/class.js @@ -336,6 +336,7 @@ function GenerateClassFromInfo(info, Base) { * to become class methods. * @template T * @param {function(T):T} mixin Optional mixin to apply to legacy base class + * before extending with Polymer metaprogramming. * @return {function(new:HTMLElement)} Generated class */ export const Class = function(info, mixin) { diff --git a/lib/legacy/legacy-data-mixin.js b/lib/legacy/legacy-data-mixin.js index a2443c7926..5aee1e0209 100644 --- a/lib/legacy/legacy-data-mixin.js +++ b/lib/legacy/legacy-data-mixin.js @@ -140,6 +140,9 @@ export const LegacyDataMixin = dedupingMixin(superClass => { }); +// LegacyDataMixin is applied to base class _before_ metaprogramming, to +// ensure override of _addPropertyEffect et.al. are used by metaprogramming +// performed in _finalizeClass Polymer.Class = (info, mixin) => Class(info, superClass => mixin ? mixin(LegacyDataMixin(superClass)) :