Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: allow hosts to create ordinary global objects #3498

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Nov 22, 2024

There doesn't seem to be a reason for this hook to only allow exotic objects.

There doesn't seem to be a reason for this hook to only allow *exotic* objects.
@Ms2ger
Copy link
Contributor Author

Ms2ger commented Nov 22, 2024

Background: the global inside a shadow realm should be ordinary, which causes an issue for the pedantic reader when we try to use this hook. I understand that Node.js also uses an ordinary object here.

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Nov 22, 2024

For context: it is already legal to have an ordinary global object that aren't just Object.create(Object.prototype) + primordials. The way you can do it is by letting InitializeHostDefinedRealm create it as Object.create(Object.prototype), and then the hosts can add more properties to it or change its prototype. Hence, this is entirely editorial.

However, having to "add more properties to it" makes it annoying when the global object is created through WebIDL, because WebIDL only has utilities to create an object from a given interface and not to "upgrade" an object to a given interface.

(I am the pedantic reader mentioned above)

Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

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

WFM

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

Successfully merging this pull request may close these issues.

3 participants