Skip to content

Integrate with MakeRealm#12580

Draft
annevk wants to merge 3 commits into
mainfrom
annevk/makerealm
Draft

Integrate with MakeRealm#12580
annevk wants to merge 3 commits into
mainfrom
annevk/makerealm

Conversation

@annevk

@annevk annevk commented Jun 15, 2026

Copy link
Copy Markdown
Member

Initial attempt at integrating with tc39/ecma262#3728.
Comment thread source
<dd>
<p>Return <var>execution context</var>.</p>
</dd>
<dd><p>Return the <span>JavaScript execution context</span> whose Realm component is

@shannonbooth shannonbooth Jun 16, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting the execution context in this way does make MakeRealm nicer, but I find it unfortunate that "realm execution context" is now less defined since there can be javascript execution contexts with the same realm components (and entry realm being defined relative to this). I was wondering here whether this algorithm should take an execution context as an argument (and extract the realm from there). Unfortunately this does go against the layering desired in tc39/ecma262#3728 though by instead doing EC into realm creation

@annevk annevk Jun 16, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need input from @jmdyck and @nicolo-ribaudo on this. I don't have strong opinions.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this does go against the layering desired in tc39/ecma262#3728 though

You can probably downgrade "desired" to "suggested". If HTML would like IHDR to pass the realm execution context (rather than the realm) to the 'customizations' callback, I don't think that's a problem.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we're happy to do whatever HTML needs, we just want to make the customizations more explicit.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I think @shannonbooth is correct that it would be less awkward if the execution context is passed in because otherwise you'd assume an accessor existing on Realm that gives you the execution context, which I don't think is what we want. I can update this PR (maybe next week) assuming that change is made on the JS side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants