@@ -360,11 +360,14 @@ function createTemplatizerClass(template, templateInfo, options) {
360
360
}
361
361
362
362
/**
363
+ * Adds propagate effects from the template to the template instance for
364
+ * properties that the host binds to the template using the `_host_` prefix.
365
+ *
363
366
* @suppress {missingProperties} class.prototype is not defined for some reason
364
367
*/
365
368
function addPropagateEffects ( template , templateInfo , options ) {
366
369
let userForwardHostProp = options . forwardHostProp ;
367
- if ( userForwardHostProp ) {
370
+ if ( userForwardHostProp && templateInfo . hasHostProps ) {
368
371
// Provide data API and property effects on memoized template class
369
372
let klass = templateInfo . templatizeTemplateClass ;
370
373
if ( ! klass ) {
@@ -423,6 +426,11 @@ function addNotifyEffects(klass, template, templateInfo, options) {
423
426
}
424
427
if ( options . forwardHostProp && template . __dataHost ) {
425
428
for ( let hprop in hostProps ) {
429
+ // As we're iterating hostProps in this function, note whether
430
+ // there were any, for an optimization in addPropagateEffects
431
+ if ( ! templateInfo . hasHostProps ) {
432
+ templateInfo . hasHostProps = true ;
433
+ }
426
434
klass . prototype . _addPropertyEffect ( hprop ,
427
435
klass . prototype . PROPERTY_EFFECT_TYPES . NOTIFY ,
428
436
{ fn : createNotifyHostPropEffect ( ) } ) ;
0 commit comments