Why globalThis instead of something intuitive like globalObject, systemGlobal, or globalEntity?

#!/JoePea joe at trusktr.io
Thu Nov 21 22:21:56 UTC 2019


> They were duly marked invalid, because the problem was with the expectations, not the behavior...

It's a design bug. I know, impossible to fix. I consider such things
valid bugs, even if no action can be taken on them.

> because reality does not match what they had been told

Reality didn't match what was intuitive. I'd say it is a DX flaw.

Honestly though, I don't know what a fix would be.

I'm not sure I even know what "globalThis" means now. :)


On Sun, Nov 17, 2019 at 11:52 AM Boris Zbarsky <bzbarsky at mit.edu> wrote:
>
> On 11/16/19 12:52 PM, #!/JoePea wrote:
> > That's the thing: the only people that may get confused are Ecmascript
> > and JS-Engine experts who know the internals very intimately.
>
> No, it's just people who have functions return values they do not expect.
>
> > and for those people that could possibly get confused, it would be
> > because they are familiar with browser internals (or hit a browser
> > *bug* like you describe)
>
> No, you misunderstand.  The bug reports were filed because the behavior
> was not what people expected.  They were duly marked invalid, because
> the problem was with the expectations, not the behavior...
>
> > For all intents and purpose, every developer I've talked to, and every
> > article I've read, treats things like `window` as the global object.
>
> And this is mostly fine as long as you don't call functions from
> navigated-away-from windows. Which most people don't, most of the time.
> And when they do, they get _very_ confused by the results, because
> reality does not match what they had been told.
>
> But that doesn't mean we should double down on telling them things that
> don't match reality.
>
> > I strongly believe that things should be made intuitive for the vast
> > majority of users
>
> I agree, but in this specific context, what does that mean in terms of
> concrete proposals you are making?
>
> -Boris


More information about the es-discuss mailing list