{"action":"opened","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/3806","labels_url":"https://api.github.com/repos/nodejs/node/issues/3806/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/3806/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/3806/events","html_url":"https://github.com/nodejs/node/issues/3806","id":116669279,"number":3806,"title":"Error upon invoking return on a generator object","user":{"login":"daniel-a-melo","id":6760808,"avatar_url":"https://avatars.githubusercontent.com/u/6760808?v=3","gravatar_id":"","url":"https://api.github.com/users/daniel-a-melo","html_url":"https://github.com/daniel-a-melo","followers_url":"https://api.github.com/users/daniel-a-melo/followers","following_url":"https://api.github.com/users/daniel-a-melo/following{/other_user}","gists_url":"https://api.github.com/users/daniel-a-melo/gists{/gist_id}","starred_url":"https://api.github.com/users/daniel-a-melo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daniel-a-melo/subscriptions","organizations_url":"https://api.github.com/users/daniel-a-melo/orgs","repos_url":"https://api.github.com/users/daniel-a-melo/repos","events_url":"https://api.github.com/users/daniel-a-melo/events{/privacy}","received_events_url":"https://api.github.com/users/daniel-a-melo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-12T23:54:06Z","updated_at":"2015-11-12T23:54:06Z","closed_at":null,"body":"Consider the following code with a generator function:\r\n\r\n```javascript\r\nfunction* finallyGen() {\r\n  try {\r\n    console.log('Started');\r\n    yield;\r\n  } finally {\r\n    console.log('Exit');\r\n  }\r\n}\r\n\r\nlet genObj1 = finallyGen();\r\nconsole.log(genObj1.next());\r\nconsole.log(genObj1.return('result'));\r\n```\r\nIt fails when executed with NodeJS 4.2.2 and 5.0.0 on Linux with the following error :+1: \r\n\r\n```\r\nTypeError: genObj1.return is not a function\r\n    at Object.<anonymous> (/generators.js:38:27)\r\n    at Module._compile (module.js:425:26)\r\n    at Object.Module._extensions..js (module.js:432:10)\r\n    at Module.load (module.js:356:32)\r\n    at Function.Module._load (module.js:311:12)\r\n    at Function.Module.runMain (module.js:457:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:972:3\r\n```\r\n\r\nWhen running it with `babel-node@6.1.18` the code executes as expected with the following output : \r\n\r\n```\r\nStarted\r\n{ value: undefined, done: false }\r\nExit\r\n{ value: 'result', done: true }\r\n```\r\n"}}