This concept of different execution contexts sharing immutable copies of certain globals could be useful for your cross-context check example.
Imagine if iframes in browsers and VM contexts in Node.js were frozen realms such that global.Date was the very same constructor across different contexts? This could make instanceof or similar proposed checks feasible.
You might be interested in this, if you have not already seen it:
This concept of different execution contexts sharing immutable copies of certain globals could be useful for your cross-context check example.
Imagine if iframes in browsers and VM contexts in Node.js were frozen realms such that
global.Date
was the very same constructor across different contexts? This could makeinstanceof
or similar proposed checks feasible.