-
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
Normative: Restriction on [[Prototype]] of the global object #1967
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24800,6 +24800,7 @@ <h1>The Global Object</h1> | |
<li>does not have a [[Construct]] internal method; it cannot be used as a constructor with the `new` operator.</li> | ||
<li>does not have a [[Call]] internal method; it cannot be invoked as a function.</li> | ||
<li>has a [[Prototype]] internal slot whose value is implementation-dependent.</li> | ||
<li>is an instance of the standard built-in Object constructor.</li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is “is an instance of the standard built-in Object constructor” an observable status / a defined concept? I’m guessing the intention here is to say that the [[Prototype]] chain (initially? permanently?) includes %Object.prototype%, which is not the same thing as being an instance of a given constructor as this phrase is used elsewhere. For example,
It’s observable (indirectly) that an object is a Boolean Object because the [[BooleanData]] slot is obtained uniquely through creation with the Boolean constructor. It’s incidental that such an object likely has %Boolean.prototype% as its [[Prototype]], and it may not — There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree with your opinion. The sentence "is instance of the the standard built-in Object constructor" does not clearly imply that the prototype chain includes %Object.prototype%. Thus, I just directly wrote that the prototype chain include %Object.prototype% and updated the pull request. |
||
<li>may have host defined properties in addition to the properties defined in this specification. This may include a property whose value is the global object itself.</li> | ||
</ul> | ||
|
||
|
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.
One of the challenges here might be that
%Object.prototype%
is a Realm-specific value, but i believe the WindowProxy causes the current realm'sObject.prototype
to report as being in the prototype chain.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.
WindowProxy.[[GetPrototypeOf]]()
returnsnull
for cross‑origin calls, which are a subset of cross‑realm calls.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.
Right - and
null
doesn't haveObject.prototype
in its prototype chain.