Skip to content

Commit

Permalink
Editorial: make the type of custom element constructors stricter
Browse files Browse the repository at this point in the history
customElement.define()'s 2nd argument "constructor" was defined as a
Function, but considering its use case in the "upgrade an element"
algorithm, the exact function type should be any ().
  • Loading branch information
yuki3 authored and domenic committed May 29, 2018
1 parent f9d325f commit f8bd887
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source
Original file line number Diff line number Diff line change
Expand Up @@ -66310,12 +66310,14 @@ console.log(plasticButton.outerHTML); // will output '<button is="plastic-but

<pre class="idl">[Exposed=Window]
interface <dfn>CustomElementRegistry</dfn> {
[<span>CEReactions</span>] void <span data-x="dom-CustomElementRegistry-define">define</span>(DOMString name, Function constructor, optional ElementDefinitionOptions options);
[<span>CEReactions</span>] void <span data-x="dom-CustomElementRegistry-define">define</span>(DOMString name, <span>CustomElementConstructor</span> constructor, optional <span>ElementDefinitionOptions</span> options);
any <span data-x="dom-CustomElementRegistry-get">get</span>(DOMString name);
Promise&lt;void&gt; <span data-x="dom-CustomElementRegistry-whenDefined">whenDefined</span>(DOMString name);
[<span>CEReactions</span>] void <span data-x="dom-CustomElementRegistry-upgrade">upgrade</span>(<span>Node</span> root);
};

callback <dfn>CustomElementConstructor</dfn> = any ();

dictionary <dfn>ElementDefinitionOptions</dfn> {
DOMString extends;
};</pre>
Expand Down

0 comments on commit f8bd887

Please sign in to comment.