Skip to content

Commit

Permalink
Merge pull request #5652 from Polymer/setAttribute-closure-types
Browse files Browse the repository at this point in the history
Update Closure types for overridden setAttribute in LegacyElementMixin.
  • Loading branch information
bicknellr authored Apr 28, 2020
2 parents 05878b6 + 604856b commit 39d5a95
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gen-tsd.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"index.html"
],
"excludeIdentifiers": [
"templatizedBase"
"templatizedBase",
"setAttribute"
],
"removeReferences": [
"../shadycss/apply-shim.d.ts",
Expand Down
8 changes: 7 additions & 1 deletion lib/legacy/legacy-element-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,15 @@ export const LegacyElementMixin = dedupingMixin((base) => {

/**
* Sets the value of an attribute.
*
* NOTE: This function is explicitly excluded when running
* gen-typescript-declarations because the function it overrides has
* different signatures in Closure and TypeScript's built-in types. This
* function's signature should match the signature from Closure:
* https://github.com/google/closure-compiler/blob/8972fd4e9b0689e7ebdeea53580521c819f6aecc/externs/browser/w3c_dom1.js#L686-L694
* @override
* @param {string} name The name of the attribute to change.
* @param {string} value The new attribute value.
* @param {string|number|boolean|!TrustedHTML|!TrustedScriptURL|!TrustedURL} value The new attribute value.
*/
setAttribute(name, value) {
if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {
Expand Down

0 comments on commit 39d5a95

Please sign in to comment.