Closed bathos closed 8 months ago
@ptomato can you clean this up?
Typically we try to check the presence of any slots used in the algorithm. If both aren’t consistently used, one technique would be to make an IsShadowRealm AO that checks both slots, and use it in the various places needed.
If this AO is called from places that in aggregate use both slots, it’s probably best to keep both checks here, redundant or no.
Ok, fair enough, closing.
@caridy @leobalter There's also #320 which I cleaned up and rebased recently, it removes [[ExecutionContext]] which would make this redundant.
The
ValidateShadowRealmObject
AO currently has two steps:Given the only path specified for creating ShadowRealm instances allocates
« [[ShadowRealm]], [[ExecutionContext]] »
up front (and given there’s no way, as far as I’m aware, for an internal slot to itself be “removed”), it seems like the second step is redundant. While it’s harmless to list both in terms of observable effects, it creates the impression that it’s possible for either of the slots to be present without the other (that’s what led me here).I think this might be a vestige of an earlier iteration of the spec because when
ValidateShadowRealmObject
was introduced (asValidateRealmObject
), it looked like this, using the generic[[Realm]]
slot rather than the API-specific[[ShadowRealm]]
slot that was introduced later: