Closed Bug 1101653 Opened 6 years ago Closed 4 years ago

Allow for (const x ... after we have a fresh binding for every iteration

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
platform-rel --- ?

People

(Reporter: evilpie, Assigned: Waldo)

References

Details

(Keywords: dev-doc-complete, DevAdvocacy)

for (const x in {}) has always been banned, because with our current semantics it wouldn't make sense at all. However when every iteration create a new binding it's totally useful.
Blocks: 1142115
Duplicate of this bug: 1237395
Duplicate of this bug: 1269863
Flags: platform-rel?
platform-rel: --- → ?
I have a PR against the Github repo/branch where bug 1263355 is being worked on, that I believe fixes this.  Don't anybody bother testing it, tho, because there are known cases (e.g. any for-in/of loop with lexical declaration whose body captures one of those lexical declarations) where the PR falls down, because the underlying branch isn't fully completed yet.

https://github.com/syg/gecko-dev/pull/1
Assignee: nobody → jwalden+bmo
Status: NEW → ASSIGNED
Duplicate of this bug: 1289459
Fixed by bug 1263355.
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.