Skip to content

Commit

Permalink
Update Closure types for overridden setAttribute in LegacyElementMixin.
Browse files Browse the repository at this point in the history
  • Loading branch information
bicknellr committed Apr 28, 2020
1 parent 05878b6 commit 604856b
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 604856b

Please sign in to comment.