diff --git a/lib/utils/templatize.js b/lib/utils/templatize.js index 4e42ae6fe1..60a2a8b104 100644 --- a/lib/utils/templatize.js +++ b/lib/utils/templatize.js @@ -392,21 +392,31 @@ function addPropagateEffects(target, templateInfo, options, methodHost) { * @constructor * @extends {DataTemplate} */ - let templatizedBase = options.mutableData ? MutableDataTemplate : DataTemplate; + let templatizedBase = + options.mutableData ? MutableDataTemplate : DataTemplate; + + // NOTE: due to https://github.com/google/closure-compiler/issues/2928, + // combining the next two lines into one assignment causes a spurious + // type error. + class TemplatizedTemplate extends templatizedBase {} /** @private */ - klass = templateInfo.templatizeTemplateClass = - class TemplatizedTemplate extends templatizedBase {}; + klass = templateInfo.templatizeTemplateClass = TemplatizedTemplate; } else { /** * @constructor * @extends {PolymerElement} */ const templatizedBase = target.constructor; + // Create a cached subclass of the base custom element class onto which // to put the template-specific propagate effects + // NOTE: due to https://github.com/google/closure-compiler/issues/2928, + // combining the next two lines into one assignment causes a spurious + // type error. + class TemplatizedTemplateExtension extends templatizedBase {} /** @private */ klass = templateInfo.templatizeTemplateClass = - class TemplatizedTemplateExtension extends templatizedBase {}; + TemplatizedTemplateExtension; } // Add template - >instances effects // and host <- template effects