Re: Fwd: .next('yo') in newborn generators

2014-02-25 Thread Andy Wingo
Hi, I don't see the point of throwing an error when calling .next('foo') on a newborn generator. We don't throw an error on .next('foo', 'bar'), and unlike the case with most function calls there is no way to get the 'bar' when resuming a generator, as you don't have an arguments object. I

Re: Fwd: .next('yo') in newborn generators

2014-02-25 Thread Erik Arvidsson
I think we can settle this now. Lets allow an argument. On Tuesday, February 25, 2014 6:27:26 AM, Brendan Eich bren...@mozilla.com wrote: Andy Wingo wrote: Hi, I don't see the point of throwing an error when calling .next('foo') on a newborn generator. We don't throw an error on

Re: .next('yo') in newborn generators

2014-02-25 Thread Allen Wirfs-Brock
On Feb 25, 2014, at 5:04 AM, Erik Arvidsson wrote: I think we can settle this now. Lets allow an argument. Fine by me. I'd be happy to make the change now and confirm it at the next meeting. I'm not expecting any push back. Allen ___

Re: Fwd: .next('yo') in newborn generators

2014-02-24 Thread Bradley Meck
Linking to some Twitter discussion related to this: https://twitter.com/bradleymeck/status/436371508005326850 On Thu, Feb 20, 2014 at 3:03 AM, David Bruant bruan...@gmail.com wrote: Le 20/02/2014 06:39, Brendan Eich a écrit : Bradley Meck wrote: If I am reading the spec right (and I may

Re: Fwd: .next('yo') in newborn generators

2014-02-20 Thread David Bruant
Le 20/02/2014 06:39, Brendan Eich a écrit : Bradley Meck wrote: If I am reading the spec right (and I may not be), only the generator should fail? The first call to gen().next(value) must have value be undefined, and the others do not check. I thought we agreed at the January 28 meeting to

Re: Re: .next('yo') in newborn generators

2014-02-19 Thread Bradley Meck
Digging up old threads, but is there a way to test for newborn generators? To my knowledge they are the only iterable that does not allow a value to be passed in at a specific time. ___ es-discuss mailing list es-discuss@mozilla.org

Re: .next('yo') in newborn generators

2014-02-19 Thread Brendan Eich
Bradley Meck wrote: Digging up old threads, but is there a way to test for newborn generators? No. To my knowledge they are the only iterable that does not allow a value to be passed in at a specific time. What do you mean by does not allow? /be

Fwd: .next('yo') in newborn generators

2014-02-19 Thread Bradley Meck
take for example a function that accepts an iterator: ```javascript function test(name, iterable) { try { var iterator = iterable[Symbol.iterator](); console.log(name,'with value for first next', iterator.next(1)) } catch(e) { console.error(name,'failed value for first next', e);

Re: Fwd: .next('yo') in newborn generators

2014-02-19 Thread Brendan Eich
Bradley Meck wrote: If I am reading the spec right (and I may not be), only the generator should fail? The first call to gen().next(value) must have value be undefined, and the others do not check. I thought we agreed at the January 28 meeting to get rid of this error, but I can't find it

.next('yo') in newborn generators

2014-01-15 Thread David Bruant
Hi, Playing with the test cases of the regenerator project [1], I came across a case and was wondering what the intention of the spec is given that Firefox and Chrome recent implementations diverge. Apologies for not reading all the previous discussions on this edge case. Test case: js

Re: .next('yo') in newborn generators

2014-01-15 Thread Allen Wirfs-Brock
On Jan 15, 2014, at 8:32 AM, David Bruant wrote: Hi, Playing with the test cases of the regenerator project [1], I came across a case and was wondering what the intention of the spec is given that Firefox and Chrome recent implementations diverge. Apologies for not reading all the