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 can only be templatized once');
}
template.__templatizeOwner = owner;
- let templateInfo = owner.constructor._parseTemplate(template);
+ const ctor = owner ? owner.constructor : TemplateInstanceBase;
+ let templateInfo = ctor._parseTemplate(template);
// Get memoized base class for the prototypical template, which
// includes property effects for binding template & forwarding
let baseClass = templateInfo.templatizeInstanceClass;
diff --git a/package.json b/package.json
index 3b0b37fbd2..7d653e1af6 100644
--- a/package.json
+++ b/package.json
@@ -31,7 +31,7 @@
"polymer-build": "^2.1.1",
"run-sequence": "^2.2.0",
"through2": "^2.0.0",
- "web-component-tester": "^6.4.1"
+ "web-component-tester": "^6.4.2"
},
"scripts": {
"build": "gulp",
diff --git a/test/unit/templatize.html b/test/unit/templatize.html
index df7be63f41..b0cc8af595 100644
--- a/test/unit/templatize.html
+++ b/test/unit/templatize.html
@@ -18,6 +18,10 @@
+
+ [[text]]
+
+