Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upwindow never returns the global object #1200
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
getify
May 22, 2018
Contributor
I apparently am uninformed on this topic... what's the difference (anything observable to userland code?) between the "global object" itself, and the "global this value"?
|
I apparently am uninformed on this topic... what's the difference (anything observable to userland code?) between the "global object" itself, and the "global this value"? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
annevk
May 22, 2018
Contributor
See WindowProxy (global this value) and Window (actual global) in the HTML Standard: https://html.spec.whatwg.org/.
|
See WindowProxy (global this value) and Window (actual global) in the HTML Standard: https://html.spec.whatwg.org/. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ljharb
May 22, 2018
Member
I think using the "global this value" - specifically, GetThisBinding(), should suffice?
|
I think using the "global this value" - specifically, GetThisBinding(), should suffice? |
ljharb
added
the
needs editorial changes
label
May 22, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
May 22, 2018
Member
The sentence in question is
This may include a property whose value is the global object itself; for example, in the HTML document object model the window property of the global object is the global object itself.
Modifying that to say "the global this value" would kind of defeat the purpose of the sentence.
Maybe instead it should be changed to talk about Node.js? Although they might also have a global this value/global object distinction inherited from V8.
Maybe the sentence should just be removed.
|
The sentence in question is
Modifying that to say "the global this value" would kind of defeat the purpose of the sentence. Maybe instead it should be changed to talk about Node.js? Although they might also have a global this value/global object distinction inherited from V8. Maybe the sentence should just be removed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
allenwb
May 22, 2018
Member
Another sentence from the ES1 spec bites the dust.
Maybe it could say "...the window property of the global object used to be..."
|
Another sentence from the ES1 spec bites the dust. Maybe it could say "...the window property of the global object used to be..." |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ryzokuken
Jun 17, 2018
Contributor
@domenic @allenwb @ljharb how should this be taken care of?
Maybe instead it should be changed to talk about Node.js? Although they might also have a global this value/global object distinction inherited from V8.
Node behaves somewhat similarly:
// browser
window === this // => true
// node.js
global === this // => trueWe could either:
(A) Change it to include what Node does, but IMHO that doesn't solve the original issue (it not correctly specifying the behavior in the browser)
(B) Change global object itself to global this value
(C) Remove the line, although shouldn't that really be the last resort?
|
@domenic @allenwb @ljharb how should this be taken care of?
Node behaves somewhat similarly: // browser
window === this // => true
// node.js
global === this // => trueWe could either: (A) Change it to include what Node does, but IMHO that doesn't solve the original issue (it not correctly specifying the behavior in the browser) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Jun 24, 2018
Member
Just removing the sentence sounds OK to me; it's hard to see how it could be clarified in a way that's helpful.
|
Just removing the sentence sounds OK to me; it's hard to see how it could be clarified in a way that's helpful. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ryzokuken
Jun 25, 2018
Contributor
@littledan will submit a patch for this later today. Just to make sure: the whole sentence should be removed and not just the example?
diff --git a/spec.html b/spec.html
index 509bff1..cb47027 100644
--- a/spec.html
+++ b/spec.html
@@ -23067,7 +23067,7 @@
<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>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; for example, in the HTML document object model the `window` property of the global object is the global object itself.</li>
+ <li>may have host defined properties in addition to the properties defined in this specification.</li>
</ul>
<emu-clause id="sec-value-properties-of-the-global-object">
|
@littledan will submit a patch for this later today. Just to make sure: the whole sentence should be removed and not just the example? diff --git a/spec.html b/spec.html
index 509bff1..cb47027 100644
--- a/spec.html
+++ b/spec.html
@@ -23067,7 +23067,7 @@
<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>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; for example, in the HTML document object model the `window` property of the global object is the global object itself.</li>
+ <li>may have host defined properties in addition to the properties defined in this specification.</li>
</ul>
<emu-clause id="sec-value-properties-of-the-global-object">
|
added a commit
to ryzokuken/ecma262
that referenced
this issue
Jun 25, 2018
ryzokuken
referenced this issue
Jun 25, 2018
Merged
Editorial: remove example for global object #1247
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ryzokuken
Jun 25, 2018
Contributor
P.S. I made a PR just removing the example and not the whole sentence, will update if needed.
|
P.S. I made a PR just removing the example and not the whole sentence, will update if needed. |
annevk commentedMay 22, 2018
It returns the "global this value".
Re: https://tc39.github.io/ecma262/#sec-global-object.