-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: GlobalObject cannot be undefined in the GetGlobalObject #3445
base: main
Are you sure you want to change the base?
Conversation
Thanks for the contribution. However, in practice, this is never actually |
So then the running execution context's Realm would be missing a |
Sorry, but I’m a bit confused about this. Does this mean that the type of [[GlobalObject]] is not undefined in step 12-15? I’m aware of issue #3482, and I’m unable to determine the type of this field after the proposed solution is applied. |
@kimjg1119 Whenever we are initializing fields or slots imperatively the type of a field is not necessarily realized until the step which initializes it. Compare, for example, |
Thanks! I agree that simply removing the initialization step with undefined should be sufficient to resolve the ESMeta alarm, so I’m completely on board with it. NOTE: We will temporarily put this in |
@@ -12054,6 +12053,7 @@ <h1>GetGlobalObject ( ): an Object</h1> | |||
</dl> | |||
<emu-alg> | |||
1. Let _currentRealm_ be the current Realm Record. | |||
1. Assert: _currentRealm_.[[GlobalObject]] is not *undefined*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assertion is no longer necessary.
The [[GlobalObject]] of the Realm record is an Object or undefined. However, it seems that in GetGlobalObject, the slot cannot be undefined. To make this clear(and resolve some ESMeta alarms), I suggest adding an assertion.