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

Normative: Clarify text about host added properties #301

Merged
merged 3 commits into from
May 5, 2021

Conversation

leobalter
Copy link
Member

Ref #284

spec.html Outdated
This specification does not recommend any specific addition.
In the Web embedding, HTML and WebIDL will specify which
interfaces are included. The Web Platform and Web-like
environments may decide to include `setTimeout`, `EventTarget`,
Copy link
Member

Choose a reason for hiding this comment

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

AFAIK setTimeout is IO. And as I explained in #284 I strongly against the host being able to add things into the realm without being able to have a clean version. This also hurts the API to be cross-platform safe.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is just an editorial note and we can remove the example.

Anyway, please keep the discussion to the respective issue.

Copy link
Member

@littledan littledan left a comment

Choose a reason for hiding this comment

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

This PR is a clean way to describe the changes due to the feedback in #284 (comment) . We will need to follow up with details in the HTML side at some point, but I don't see why that should block Stage 3 (though it will block shipping in web browsers).

Comment on lines +365 to +367
platform capabilities with no authority to cause side effects such
as I/O or mutation of values that are shared across different
realms within the same host environment.
Copy link
Member

@Jack-Works Jack-Works May 4, 2021

Choose a reason for hiding this comment

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

with no authority to cause side effects such as I/O or mutation of values that are shared across different realms

This is not enough for the SES requirement.

Imagine the host provide a counter { [[Get]]: () => #counter, [[Set]]: (val) => #counter = val } property on the Realm's global object, this provides a shared global state within the Realm (not shared across different realms). It provides a communication channel in the different compartments within the same realm.

Copy link
Member

Choose a reason for hiding this comment

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

I guess I read the text to cover that case--I see the code sample as a value shared across realms, at a high level. I guess we just need to iterate on the wording so that it's maximally clear.

Copy link
Member

Choose a reason for hiding this comment

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

If #counter is a host-defined pre-realm internal state, it will be a mutable state within the Realm and passes the current spec text but violate the SES requirement.

@ljharb
Copy link
Member

ljharb commented May 4, 2021

Something known that would block shipping in web browsers should of course block stage 3 - since the point of stage 3 is to ship it in web browsers.

@leobalter
Copy link
Member Author

My guess is that a stage 3 would facilitate implementation without holding on what properties are added through HTML. This clears path for experimenting in this integration, while providing a fairly stable contract of a spec candidate from the ECMAScript side.

@littledan
Copy link
Member

Something known that would block shipping in web browsers should of course block stage 3 - since the point of stage 3 is to ship it in web browsers.

I don't think this is how we've been doing things. We have frequently continued to iterate on HTML integration PRs after Stage 3 in recent proposals. test262 is also usually required for browsers to ship, but it's not a Stage 3 requirement. I think we should leave it up to the HTML folks whether they feel like things are complete enough on their end to go to Stage 3.

@leobalter leobalter merged commit f220db8 into main May 5, 2021
@leobalter leobalter deleted the leo/284/host-definitions branch May 5, 2021 18:16
@Jack-Works Jack-Works mentioned this pull request May 20, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants