diff --git a/lib/elements/dom-bind.html b/lib/elements/dom-bind.html index bb51786ef1..9301621a4b 100644 --- a/lib/elements/dom-bind.html +++ b/lib/elements/dom-bind.html @@ -56,7 +56,7 @@ constructor() { super(); - if (window.strictTemplatePolicy) { + if (Polymer.strictTemplatePolicy) { throw new Error(`strictTemplatePolicy: dom-bind not allowed`); } this.root = null; diff --git a/lib/elements/dom-module.html b/lib/elements/dom-module.html index c385cf19ec..9fa8d88e86 100644 --- a/lib/elements/dom-module.html +++ b/lib/elements/dom-module.html @@ -124,7 +124,7 @@ register(id) { id = id || this.id; if (id) { - if (window.strictTemplatePolicy && findModule(id)) { + if (Polymer.strictTemplatePolicy && findModule(id)) { modules[id] = lcModules[id.toLowerCase()] = null; throw new Error(`strictTemplatePolicy: dom-module ${id} registered twice`); } diff --git a/lib/legacy/class.html b/lib/legacy/class.html index 66ba81326b..b0b00c8aef 100644 --- a/lib/legacy/class.html +++ b/lib/legacy/class.html @@ -169,7 +169,7 @@ // finally fall back to `_template` in element's prototype. this.prototype._template || null; - if (window.strictTemplatePolicy && !template) { + if (Polymer.strictTemplatePolicy && !template) { throw new Error(`strictTemplatePolicy: expecting dom-module or null _template for ${this.is}`); } return template; diff --git a/lib/mixins/element-mixin.html b/lib/mixins/element-mixin.html index b059f0e216..c51aceb3cd 100644 --- a/lib/mixins/element-mixin.html +++ b/lib/mixins/element-mixin.html @@ -392,7 +392,7 @@ // template; call the super impl this way so that `this` points // to the superclass. Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template; - if (window.strictTemplatePolicy && this.is && !template) { + if (Polymer.strictTemplatePolicy && this.is && !template) { throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${this.is}`); } this._template = template; diff --git a/lib/utils/templatize.html b/lib/utils/templatize.html index 8f2108c000..314613cc41 100644 --- a/lib/utils/templatize.html +++ b/lib/utils/templatize.html @@ -500,7 +500,7 @@ * @suppress {invalidCasts} */ templatize(template, owner, options) { - if (window.strictTemplatePolicy && !owner._methodHost) { + if (Polymer.strictTemplatePolicy && !owner._methodHost) { throw new Error('strictTemplatePolicy: template owner not trusted'); } options = /** @type {!TemplatizeOptions} */(options || {}); diff --git a/test/unit/strict-template-policy.html b/test/unit/strict-template-policy.html index f6603e91b7..108f127611 100644 --- a/test/unit/strict-template-policy.html +++ b/test/unit/strict-template-policy.html @@ -12,7 +12,9 @@