Rick, copy and paste in Firefox--the ones who are most involve in the spec 
direction--:

function r(){
     var i = 0, a = [0,9,8,7,6,5,4,3,2,1];   
     return (function (){return a.pop();});
 }
 
var rr = r();
 
function y(){
     let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
     while(a){
         yield (a.pop());
     }
}
 
let yy = y();
 
function* g(){
     let i = 0, a = [0,9,8,7,6,5,4,3,2,1];
     while(a){
         yield (a.pop());
     }
}
 
let gg = g();
 
console.log("return: " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + 
rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + rr() + " " + 
rr()  + "\n" +
      "yield: " + yy.next() + " " + yy.next() + " " + yy.next() + " " + 
yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + " " + 
yy.next() + " " + yy.next() + " " + yy.next() + " " + yy.next() + "\n" +
      "function*: " + JSON.stringify([gg.next(), gg.next(), gg.next(), 
gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), gg.next(), 
gg.next()]));
 
/*
return: 1 2 3 4 5 6 7 8 9 0 undefined
yield: 1 2 3 4 5 6 7 8 9 0 undefined
function*: 
[{"value":1,"done":false},{"value":2,"done":false},{"value":3,"done":false},{"value":4,"done":false},{"value":5,"done":false},{"value":6,"done":false},{"value":7,"done":false},{"value":8,"done":false},{"value":9,"done":false},{"value":0,"done":false},{"done":false}]
*/
 

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/cfb22331-3b40-424e-a6d9-a85d765db51c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to