let definition in global scope creates a property on window (docs say it shouldn't)

RESOLVED INVALID

Status

()

RESOLVED INVALID
7 years ago
7 years ago

People

(Reporter: al_9x, Unassigned)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
https://groups.google.com/group/mozilla.dev.tech.js-engine/browse_thread/thread/1d860cd7c067fa98

"In programs and classes let does not create properties on the global object 
like var does; instead, it creates properties in an implicit block created 
for the evaluation of statements in those contexts."
https://developer.mozilla.org/en/New_in_JavaScript_1.7

but in Fx10 the following does create a "window.a"

<script type="application/javascript;version=1.8">
let a = 1;
</scipt>
I've updated the wiki page; I'm not sure how someone got that idea, but it was possibly wishful thinking due to the ES4 work going on at the time. That work has since been cancelled, so the behavior of let is currently just "what SpiderMonkey does."

In ES6, let is being specified fully and this issue of global scope will likely be revisited.

Dave
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.