for (x in generator()) should not call the generator's .next() method

RESOLVED DUPLICATE of bug 1012480

Status

()

RESOLVED DUPLICATE of bug 1012480
5 years ago
4 years ago

People

(Reporter: jorendorff, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
This test fails. Should pass per ES6.

    function* gen() { yield 1; }
    for (x in gen())
        throw "FAIL";

Comment 1

5 years ago
Confirmed.
(Assignee)

Updated

4 years ago
Assignee: general → nobody

Comment 2

4 years ago
What is worse is that it's a race condition. We never get to "PASS"

    function* gen() { yield 1; }
    for (x in gen()){}
    throw "PASS"
Sorry, I had overlooked this.
This is the same bug as bug 1012480, and it's already fixed on mozilla-beta (34).
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1012480
You need to log in before you can comment on or make changes to this bug.