Skip to content

Commit

Permalink
Add comments re: need for mixing in before metaprogramming
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Aug 28, 2018
1 parent 2d06ff5 commit d93cbfa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/legacy/class.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 3 additions & 0 deletions lib/legacy/legacy-data-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)) :
Expand Down

0 comments on commit d93cbfa

Please sign in to comment.