Re: [WICG/webcomponents] [scoped-registries] Interaction with HTML element's overridden constructor steps (Issue #969)

> No. It just means that you can't recursively call your own constructor before super() - which is already a restriction due to how upgrades work.

While it wouldn’t be advisable or useful to do so, it’s not a runtime restriction (and seemingly can’t be, at least in terms of ES code semantics) because there’s nothing to key a specific expected invocation of `HTMLElement.[[Construct]](args, newTarget)` to an associated registry except for the identity of its `newTarget` argument.

The example below shows how the intended registries can get swapped as a consequence — pretend `new Foo("scoped")` is being invoked with a scoped registry:

![image](https://user-images.githubusercontent.com/6257356/223464509-5616caf3-48fa-45db-b188-51866f59ffb5.png)

I think this is the case @xiaochengh described [above](https://github.com/WICG/webcomponents/issues/969#issuecomment-1396352059). If this was already apparent, are you saying it’s okay if it’s not guaranteed that the registry associated with the instance `super()` furnishes will match the registry associated with the outer CE constructor invocation?


-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/969#issuecomment-1458418288
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/969/1458418288@github.com>

Received on Tuesday, 7 March 2023 16:00:47 UTC