Skip to content

Commit

Permalink
guard all dommodule references
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred K. Schott committed Jun 6, 2017
1 parent 3380c78 commit c3866a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/legacy/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
// get template first from any imperative set in `info._template`
return info._template ||
// next look in dom-module associated with this element's is.
Polymer.DomModule.import(this.is, 'template') ||
Polymer.DomModule && Polymer.DomModule.import(this.is, 'template') ||
// next look for superclass template (note: use superclass symbol
// to ensure correct `this.is`)
Base.template ||
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@
*/
static get template() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {
this._template = Polymer.DomModule.import(this.is, 'template') ||
this._template = Polymer.DomModule && Polymer.DomModule.import(this.is, 'template') ||
// note: implemented so a subclass can retrieve the super
// template; call the super impl this way so that `this` points
// to the superclass.
Expand All @@ -557,7 +557,7 @@
*/
static get importPath() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) {
const module = Polymer.DomModule.import(this.is);
const module = Polymer.DomModule && Polymer.DomModule.import(this.is);
this._importPath = module ? module.assetpath : '' ||
Object.getPrototypeOf(this.prototype).constructor.importPath;
}
Expand Down

0 comments on commit c3866a5

Please sign in to comment.