Closed Bug 700859 Opened 14 years ago Closed 14 years ago

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

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: al_9x, Unassigned)

Details

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
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.