-
Notifications
You must be signed in to change notification settings - Fork 36
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
Setting a realm's global object #8
Comments
I may be putting the horse before the carriage here. I've opened tc39/test262#538 to learn more about exotic global objects. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
eshost currently allows for the specification of global bindings during ECMAScript realm creation. These bindings are created as enumerable, writable, and configurable properties of the global object.
The ES2015 specification defines behavior for global object properties with different descriptors. Although some of these can be tested by runtime creation of properties, e.g.
...others cannot. For example the semantics of GlobalDeclarationEvaluation dictate (via CanDeclareGlobalFunction) that if the global object has a property named
foo
that has the valueundefined
and the descriptor {[[Configurable]]: false, [[Writable]]: true, [[Enumerable]]: true}, the following code should execute without error:One solution would be to extend the eshost API to respect the property descriptors of the provided object, but the spec also accounts for global objects that are exotic. For example, here's a non-normative note from GlobalDeclarationEvaluation:
So I think we need the ability to specify the global object directly. Does that sound right to you, @bterlson? I'm also interested in this detail as it relates to Test262. If what I've written above is accurate, we will one day need to write tests that dictate a realm's global object value.
The text was updated successfully, but these errors were encountered: