Skip to content

Commit

Permalink
Add some casts for places Closure doesn't understand constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
aomarks committed Jun 3, 2019
1 parent 0ae14b9 commit 10d43ce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/utils/templatize.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ function upgradeTemplate(template, constructor) {
* @implements {Polymer_PropertyEffects}
* @private
*/
const templateInstanceBase = PropertyEffects(class {});
const templateInstanceBase = PropertyEffects(
// This cast shouldn't be neccessary, but Closure doesn't understand that
// "class {}" is a constructor function.
/** @type {function(new:Object)} */(class {}));

/**
* @polymer
Expand Down Expand Up @@ -317,7 +320,10 @@ TemplateInstanceBase.prototype.__hostProps;
* @implements {Polymer_MutableData}
* @private
*/
const MutableTemplateInstanceBase = MutableData(TemplateInstanceBase);
const MutableTemplateInstanceBase = MutableData(
// This cast shouldn't be necessary, but Closure doesn't seem to understand
// this constructor.
/** @type {function(new:TemplateInstanceBase)} */(TemplateInstanceBase));

function findMethodHost(template) {
// Technically this should be the owner of the outermost template.
Expand Down

0 comments on commit 10d43ce

Please sign in to comment.