ericmckean / traceur-compiler

Automatically exported from code.google.com/p/traceur-compiler
Apache License 2.0
0 stars 0 forks source link

Generators produce an object with a moveNext() method; expected next() #183

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Paste the following code into 
http://traceur-compiler.googlecode.com/git/demo/repl.html

function* gen() {
  var k = 0;
  while ( true ) {
    yield ++k;
  }
}

var g = gen();

g.next();

The expected output should be the number 1, instead I see the exception: 

Object #<Object> has no method 'next'

The compiled code that is displayed on the right reveals that the method has 
been named "moveNext" instead of "next"

Original issue reported on code.google.com by waldron....@gmail.com on 14 Dec 2012 at 8:37

GoogleCodeExporter commented 9 years ago

Original comment by arv@chromium.org on 14 Dec 2012 at 10:15

GoogleCodeExporter commented 9 years ago
I had considered adding this as a comment to that ticket... Sorry for the dup!

Original comment by waldron....@gmail.com on 14 Dec 2012 at 10:25