Closed Bug 1163348 Opened 9 years ago Closed 9 years ago

Wrong behavior regarding ECMAScript-6 generators

Categories

(Core :: JavaScript Engine, defect)

37 Branch
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1147371

People

(Reporter: ralfdoe123, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/41.0.2272.76 Chrome/41.0.2272.76 Safari/537.36

Steps to reproduce:

Firefox Version 37.0.2
On LinuxMint 17.1 (64-bit)
For information: Same issue with "Node v0.12.2" with harmony flag enabled and Chromium 41 browser.

Hello everybody,

I think (or at least I hope) the following programm should behave different than currently been done in Firefox (for example Traceur does it right, or in slightly different syntax also Gorillascript and PHP 5.6):

=======
Program
=======

var generator = function* () {
    console.log("Open resource");
    
    try {
        yield 1;
        yield 2;
        yield 3;
        yield 4;
        yield 5;
     } finally {
        console.log("Close resource");
    }
}

for (var item of generator()) {
    console.log(item);

   if (item === 3) break;
}



Actual results:

[Incorrect output]
"Open resource"
1
2
3



Expected results:

[Correct output]
"Open resource"
1
2
3
"Close resource"
Version: 33 Branch → 37 Branch
Blocks: es6
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Flags: needinfo?(jorendorff)
Sorry for the delay. This is definitely a real bug, but it happens to already be on file.
Status: UNCONFIRMED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(jorendorff)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.