-
Notifications
You must be signed in to change notification settings - Fork 67
Description
@domenic raised this concern during a conversation today. From what I gathered:
- one issue will be that some web semantics that were designed to rely on a ref's associated realm to carry on certain operation. The example used was
Function.prototype.bind
, which creates a new function from another realm, that in conjunction with APIs likepostMessage
, could cause issues.
TBH, I still don't fully understand the problem, mostly because the flip side of this is what the associated realm is used for when post messaging? and whether or not the "forwarding" mechanism that @littledan has been working on helps with this? considering that the window and the newly created realm acted as a group "sharing" the settings.
- another issue that he mentioned here is the potential hazard of having multiple
Object.prototype
,Function.prototype
, etc.
We have thought about this issue a lot, it is what we call "identity discontinuity hazard", and it is a real hazard for developers, but we have learned to deal with it. In nodejs, this problem is very common. In the web, same domain iframes exhibit the same issue as well. It is something that can be solved with a "near membrane". But I do acknowledge that adding yet one more way to have this issue in the web is concerning.
@domenic also suggested some other areas of explorations here, if the main goal is to have a new set of mutable intrinsics. Something more aligned with a powerful evaluator that can give you the controls to resolve what reference to use during evaluation of code or modules. This sounds a lot like the parameterized evaluator that we have discussed extensibly, and somehow has mutated into the container's proposal. I am up for experimenting in this area.