From bde5898e0335dfcb55cfc50380d08780fef4a0cc Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Wed, 10 Jan 2018 11:00:34 -0800 Subject: [PATCH] Allow templatizer to be used without owner or host prop forwarding. Fixes #4458 --- lib/utils/templatize.html | 18 +++++++++--------- package.json | 2 +- test/unit/templatize.html | 29 +++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/lib/utils/templatize.html b/lib/utils/templatize.html index fad92ff748..dbd69d4505 100644 --- a/lib/utils/templatize.html +++ b/lib/utils/templatize.html @@ -77,7 +77,8 @@ children.push(n); n.__templatizeInstance = this; } - if (this.__templatizeOwner.__hideTemplateChildren__) { + if (this.__templatizeOwner && + this.__templatizeOwner.__hideTemplateChildren__) { this._showHideChildren(true); } // Flush props only when props are passed if instance props exist @@ -96,15 +97,13 @@ */ _configureProperties(props) { let options = this.__templatizeOptions; - if (props) { - for (let iprop in options.instanceProps) { - if (iprop in props) { - this._setPendingProperty(iprop, props[iprop]); - } + if (options.forwardHostProp) { + for (let hprop in this.__hostProps) { + this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]); } } - for (let hprop in this.__hostProps) { - this._setPendingProperty(hprop, this.__dataHost['_host_' + hprop]); + for (let iprop in props) { + this._setPendingProperty(iprop, props[iprop]); } } /** @@ -464,7 +463,8 @@ throw new Error('A