Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Current spec text unclear wrt. realm #38

Closed
bmeurer opened this issue Oct 25, 2018 · 1 comment · Fixed by #85
Closed

Current spec text unclear wrt. realm #38

bmeurer opened this issue Oct 25, 2018 · 1 comment · Fixed by #85

Comments

@bmeurer
Copy link

bmeurer commented Oct 25, 2018

The current text as it stands doesn't make it clear in which realm the DoAgentFinalization is supposed to run, which then leaves it open which realm is used by the EnqueueJob, which in turn means that it's unclear in which realm the WeakFactoryCleanupJob has to run.

Since WeakFactoryCleanupJob creates JavaScript objects and even calls into arbitrary user code - aka [Cleanup] - which might not even be callable, it has to have some current realm.

One obvious solution here would be remember either the realm or the current execution context on the WeakFactory and enter that realm in DoAgentFinalization for that particular factory.

@littledan
Copy link
Member

@bmeurer This suggestion sounds right to me, and mirrors similar logic in WebIDL (recently made concrete by @Ms2ger). Here, as you say, each FinalizationGroup could have its own [[Realm]] internal slot, which is used to look up the %FinalizationGroupCleanupIterator% when constructing one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants