Skip to content

Commit d93cbfa

Browse files
committed
Add comments re: need for mixing in before metaprogramming
1 parent 2d06ff5 commit d93cbfa

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/legacy/class.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ function GenerateClassFromInfo(info, Base) {
336336
* to become class methods.
337337
* @template T
338338
* @param {function(T):T} mixin Optional mixin to apply to legacy base class
339+
* before extending with Polymer metaprogramming.
339340
* @return {function(new:HTMLElement)} Generated class
340341
*/
341342
export const Class = function(info, mixin) {

lib/legacy/legacy-data-mixin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@ export const LegacyDataMixin = dedupingMixin(superClass => {
140140

141141
});
142142

143+
// LegacyDataMixin is applied to base class _before_ metaprogramming, to
144+
// ensure override of _addPropertyEffect et.al. are used by metaprogramming
145+
// performed in _finalizeClass
143146
Polymer.Class = (info, mixin) => Class(info,
144147
superClass => mixin ?
145148
mixin(LegacyDataMixin(superClass)) :

0 commit comments

Comments
 (0)