Skip to content

Commit

Permalink
Make sure closure types have braces
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Sep 8, 2017
1 parent e45e5bb commit fb8039e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
20 changes: 10 additions & 10 deletions lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
JSCompiler_renameProperty('__ownProperties', klass))) {
klass.__ownProperties =
klass.hasOwnProperty(JSCompiler_renameProperty('properties', klass)) ?
/** @type PolymerElementConstructor */ (klass).properties : {};
/** @type {PolymerElementConstructor} */ (klass).properties : {};
}
return klass.__ownProperties;
}
Expand All @@ -134,7 +134,7 @@
JSCompiler_renameProperty('__ownObservers', klass))) {
klass.__ownObservers =
klass.hasOwnProperty(JSCompiler_renameProperty('observers', klass)) ?
/** @type PolymerElementConstructor */ (klass).observers : [];
/** @type {PolymerElementConstructor} */ (klass).observers : [];
}
return klass.__ownObservers;
}
Expand Down Expand Up @@ -178,7 +178,7 @@
let superCtor = Object.getPrototypeOf(klass.prototype).constructor;
if (superCtor.prototype instanceof PolymerElement) {
klass.__classProperties = Object.assign(
Object.create(propertiesForClass(/** @type PolymerElementConstructor */(superCtor))),
Object.create(propertiesForClass(/** @type {PolymerElementConstructor} */(superCtor))),
klass.__classProperties);
}
}
Expand Down Expand Up @@ -232,7 +232,7 @@
* @private
*/
function finalizeClassAndSuper(klass) {
let proto = /** @type PolymerElementConstructor */ (klass).prototype;
let proto = /** @type {PolymerElementConstructor} */ (klass).prototype;
let superCtor = Object.getPrototypeOf(proto).constructor;
if (superCtor.prototype instanceof PolymerElement) {
superCtor.finalize();
Expand All @@ -251,7 +251,7 @@
*/
function finalizeClass(klass) {
klass.__finalized = true;
let proto = /** @type PolymerElementConstructor */ (klass).prototype;
let proto = /** @type {PolymerElementConstructor} */ (klass).prototype;
if (klass.hasOwnProperty(
JSCompiler_renameProperty('is', klass)) && klass.is) {
Polymer.telemetry.register(proto);
Expand All @@ -265,7 +265,7 @@
finalizeObservers(proto, observers, props);
}
// note: create "working" template that is finalized at instance time
let template = /** @type PolymerElementConstructor */ (klass).template;
let template = /** @type {PolymerElementConstructor} */ (klass).template;
if (template) {
if (typeof template === 'string') {
let t = document.createElement('template');
Expand Down Expand Up @@ -515,11 +515,11 @@
static get template() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_template', this))) {
this._template = Polymer.DomModule && Polymer.DomModule.import(
/** @type PolymerElementConstructor*/ (this).is, 'template') ||
/** @type {PolymerElementConstructor}*/ (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.
Object.getPrototypeOf(/** @type PolymerElementConstructor*/ (this).prototype).constructor.template;
Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.template;
}
return this._template;
}
Expand All @@ -537,9 +537,9 @@
*/
static get importPath() {
if (!this.hasOwnProperty(JSCompiler_renameProperty('_importPath', this))) {
const module = Polymer.DomModule && Polymer.DomModule.import(/** @type PolymerElementConstructor */ (this).is);
const module = Polymer.DomModule && Polymer.DomModule.import(/** @type {PolymerElementConstructor} */ (this).is);
this._importPath = module ? module.assetpath : '' ||
Object.getPrototypeOf(/** @type PolymerElementConstructor*/ (this).prototype).constructor.importPath;
Object.getPrototypeOf(/** @type {PolymerElementConstructor}*/ (this).prototype).constructor.importPath;
}
return this._importPath;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -359,15 +359,15 @@

case Object:
try {
outValue = JSON.parse(/** @type string */(value));
outValue = JSON.parse(/** @type {string} */(value));
} catch(x) {
// allow non-JSON literals like Strings and Numbers
}
break;

case Array:
try {
outValue = JSON.parse(/** @type string */(value));
outValue = JSON.parse(/** @type {string} */(value));
} catch(x) {
outValue = null;
console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${value}`);
Expand Down
4 changes: 2 additions & 2 deletions lib/mixins/template-stamp.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
*/
static _parseTemplateNode(node, templateInfo, nodeInfo) {
let noted;
let element = /** @type Element */(node);
let element = /** @type {Element} */(node);
if (element.localName == 'template' && !element.hasAttribute('preserve-content')) {
noted = this._parseTemplateNestedTemplate(element, templateInfo, nodeInfo) || noted;
} else if (element.localName === 'slot') {
Expand Down Expand Up @@ -418,7 +418,7 @@
let templateInfo = this.constructor._parseTemplate(template);
let nodeInfo = templateInfo.nodeInfoList;
let content = templateInfo.content || template.content;
let dom = /** @type DocumentFragment */ (document.importNode(content, true));
let dom = /** @type {DocumentFragment} */ (document.importNode(content, true));
// NOTE: ShadyDom optimization indicating there is an insertion point
dom.__noInsertionPoint = !templateInfo.hasInsertionPoint;
let nodes = dom.nodeList = new Array(nodeInfo.length);
Expand Down

0 comments on commit fb8039e

Please sign in to comment.