{"action":"created","issue":{"url":"https://api.github.com/repos/tddbin/es6katas.org/issues/15","labels_url":"https://api.github.com/repos/tddbin/es6katas.org/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/tddbin/es6katas.org/issues/15/comments","events_url":"https://api.github.com/repos/tddbin/es6katas.org/issues/15/events","html_url":"https://github.com/tddbin/es6katas.org/issues/15","id":93134682,"number":15,"title":"Kata 52:Passing a value to the first next() call does NOT throw","user":{"login":"serratus","id":1381822,"avatar_url":"https://avatars.githubusercontent.com/u/1381822?v=3","gravatar_id":"","url":"https://api.github.com/users/serratus","html_url":"https://github.com/serratus","followers_url":"https://api.github.com/users/serratus/followers","following_url":"https://api.github.com/users/serratus/following{/other_user}","gists_url":"https://api.github.com/users/serratus/gists{/gist_id}","starred_url":"https://api.github.com/users/serratus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/serratus/subscriptions","organizations_url":"https://api.github.com/users/serratus/orgs","repos_url":"https://api.github.com/users/serratus/repos","events_url":"https://api.github.com/users/serratus/events{/privacy}","received_events_url":"https://api.github.com/users/serratus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-05T18:39:54Z","updated_at":"2015-07-15T21:16:13Z","closed_at":null,"body":"First off, thanks for this collection of great katas, as they really help me get on track with ES6. \r\n\r\nWhile I was trying to finish the [send-value](http://tddbin.com/#?kata=es6/language/generator/send-value) kata on generators, I noticed an inconsistency: In the last example, the code should throw an error, but doesn't.\r\n```javascript\r\nit('passing a value to the first `next()` call throws', function() {\r\n  function* generatorFunction() {\r\n    yield 1;\r\n    yield 2;\r\n  }\r\n\r\n  assert.throws(function() { generatorFunction().next('4343'); });\r\n});\r\n```\r\n\r\n![6eac070acc9667481393207bab51f96c](https://cloud.githubusercontent.com/assets/1381822/8512845/ca786f02-2355-11e5-8d77-e5d0c600574d.png)\r\n\r\nEven Mozilla [states](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators) the following:  \r\n> However, starting a newborn generator with any value other than undefined when calling next() will result in a TypeError exception.\r\n\r\nBut the example simply won't throw an error. I even tested it with babel deactivated on FF 39 and Chrome 43, but everything stays quiet.\r\n\r\nAny ideas?"},"comment":{"url":"https://api.github.com/repos/tddbin/es6katas.org/issues/comments/121750769","html_url":"https://github.com/tddbin/es6katas.org/issues/15#issuecomment-121750769","issue_url":"https://api.github.com/repos/tddbin/es6katas.org/issues/15","id":121750769,"user":{"login":"wolframkriesing","id":113427,"avatar_url":"https://avatars.githubusercontent.com/u/113427?v=3","gravatar_id":"","url":"https://api.github.com/users/wolframkriesing","html_url":"https://github.com/wolframkriesing","followers_url":"https://api.github.com/users/wolframkriesing/followers","following_url":"https://api.github.com/users/wolframkriesing/following{/other_user}","gists_url":"https://api.github.com/users/wolframkriesing/gists{/gist_id}","starred_url":"https://api.github.com/users/wolframkriesing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wolframkriesing/subscriptions","organizations_url":"https://api.github.com/users/wolframkriesing/orgs","repos_url":"https://api.github.com/users/wolframkriesing/repos","events_url":"https://api.github.com/users/wolframkriesing/events{/privacy}","received_events_url":"https://api.github.com/users/wolframkriesing/received_events","type":"User","site_admin":false},"created_at":"2015-07-15T21:16:13Z","updated_at":"2015-07-15T21:16:13Z","body":"Ok, I read a lot of spec and articles now, it seems this was wrong behavior, I should have read the spec when I wrote this, sorry ... fixing it in a sec\r\n    (Note: At the time of writing, nightlies of both Chrome and FF are fine, but other browsers may not yet be fully compliant and may incorrectly throw an error in this case).\r\nis written in here http://davidwalsh.name/es6-generators"}}