Skip to content

Commit

Permalink
Add some comments and readonly markers
Browse files Browse the repository at this point in the history
  • Loading branch information
rictic committed Dec 8, 2023
1 parent 6a48dd2 commit aca1fff
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ interface CustomElementRegistry {

interface CustomElementDefinition {
elementClass: CustomElementConstructor;
/**
* We hold onto the versions of callbacks at registration time, because that's the
* specc'd behavior.
*/
connectedCallback?: CustomHTMLElement['connectedCallback'];
disconnectedCallback?: CustomHTMLElement['disconnectedCallback'];
adoptedCallback?: CustomHTMLElement['adoptedCallback'];
Expand Down Expand Up @@ -107,16 +111,19 @@ if (!ShadowRoot.prototype.createElement) {
// register stand-in elements that can delegate out to CE classes registered
// in scoped registries
class ShimmedCustomElementsRegistry implements CustomElementRegistry {
private _definitionsByTag = new Map<string, CustomElementDefinition>();
private _definitionsByClass = new Map<
private readonly _definitionsByTag = new Map<
string,
CustomElementDefinition
>();
private readonly _definitionsByClass = new Map<
CustomElementConstructor,
CustomElementDefinition
>();
private _whenDefinedPromises = new Map<
private readonly _whenDefinedPromises = new Map<
string,
AsyncInfo<CustomElementConstructor>
>();
private _awaitingUpgrade = new Map<string, Set<HTMLElement>>();
private readonly _awaitingUpgrade = new Map<string, Set<HTMLElement>>();

define(tagName: string, elementClass: CustomElementConstructor) {
tagName = tagName.toLowerCase();
Expand Down

0 comments on commit aca1fff

Please sign in to comment.