If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

"for(let a of array) command;" scoped differently then "for(let a of array){ command; }"

RESOLVED INVALID

Status

()

Core
JavaScript Engine
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: blindwanderer, Unassigned)

Tracking

29 Branch
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 Firefox/29.0 (Beta/Release)
Build ID: 20140506152807

Steps to reproduce:

for(let field of groupProxies)
	proxied[field] = {get: function(){ return field; }, enumerable:true};



Actual results:

It executed as if it were:
for(var field of groupProxies){
	proxied[field] = {get: function(){ return field; }, enumerable:true};
}


Expected results:

It should have executed like:
for(let field of groupProxies){
	proxied[field] = {get: function(){ return field; }, enumerable:true};
}
(which works as expected)
(Reporter)

Comment 1

3 years ago
To some things up, the curly brackets determine if "let" is treated as "let" or as if it were a "var".
(Reporter)

Comment 2

3 years ago
o_o!!!
I can't get this to produce the expected result at all!!!

It was working the other day I swear. wtf. sorry. Since the expected result never works it can' really be a scoping bug. sorry.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.