Skip to content

Commit 10d43ce

Browse files
committed
Add some casts for places Closure doesn't understand constructor
1 parent 0ae14b9 commit 10d43ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/utils/templatize.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ function upgradeTemplate(template, constructor) {
101101
* @implements {Polymer_PropertyEffects}
102102
* @private
103103
*/
104-
const templateInstanceBase = PropertyEffects(class {});
104+
const templateInstanceBase = PropertyEffects(
105+
// This cast shouldn't be neccessary, but Closure doesn't understand that
106+
// "class {}" is a constructor function.
107+
/** @type {function(new:Object)} */(class {}));
105108

106109
/**
107110
* @polymer
@@ -317,7 +320,10 @@ TemplateInstanceBase.prototype.__hostProps;
317320
* @implements {Polymer_MutableData}
318321
* @private
319322
*/
320-
const MutableTemplateInstanceBase = MutableData(TemplateInstanceBase);
323+
const MutableTemplateInstanceBase = MutableData(
324+
// This cast shouldn't be necessary, but Closure doesn't seem to understand
325+
// this constructor.
326+
/** @type {function(new:TemplateInstanceBase)} */(TemplateInstanceBase));
321327

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

0 commit comments

Comments
 (0)