Skip to content

Commit

Permalink
Merge pull request #5650 from Polymer/attribute-override-types
Browse files Browse the repository at this point in the history
Fix TypeScript breakages by specifying types for overridden `setAttribute` and `getAttribute`.
  • Loading branch information
bicknellr authored Apr 28, 2020
2 parents 282bd34 + 370ae5e commit f73c89b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ export const LegacyElementMixin = dedupingMixin((base) => {
}
}

/** @override */
/**
* Sets the value of an attribute.
* @override
* @param {string} name The name of the attribute to change.
* @param {string} value The new attribute value.
*/
setAttribute(name, value) {
if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {
const oldValue = this.getAttribute(name);
Expand All @@ -155,7 +160,11 @@ export const LegacyElementMixin = dedupingMixin((base) => {
}
}

/** @override */
/**
* Removes an attribute.
* @override
* @param {string} name The name of the attribute to remove.
*/
removeAttribute(name) {
if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {
const oldValue = this.getAttribute(name);
Expand Down

0 comments on commit f73c89b

Please sign in to comment.