{"action":"created","issue":{"url":"https://api.github.com/repos/babel/babel/issues/963","labels_url":"https://api.github.com/repos/babel/babel/issues/963/labels{/name}","comments_url":"https://api.github.com/repos/babel/babel/issues/963/comments","events_url":"https://api.github.com/repos/babel/babel/issues/963/events","html_url":"https://github.com/babel/babel/issues/963","id":60144909,"number":963,"title":"For of + switch behaves incorrectly","user":{"login":"Y0ba","id":1163958,"avatar_url":"https://avatars.githubusercontent.com/u/1163958?v=3","gravatar_id":"","url":"https://api.github.com/users/Y0ba","html_url":"https://github.com/Y0ba","followers_url":"https://api.github.com/users/Y0ba/followers","following_url":"https://api.github.com/users/Y0ba/following{/other_user}","gists_url":"https://api.github.com/users/Y0ba/gists{/gist_id}","starred_url":"https://api.github.com/users/Y0ba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Y0ba/subscriptions","organizations_url":"https://api.github.com/users/Y0ba/orgs","repos_url":"https://api.github.com/users/Y0ba/repos","events_url":"https://api.github.com/users/Y0ba/events{/privacy}","received_events_url":"https://api.github.com/users/Y0ba/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/babel/babel/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/babel/babel/labels/transformation","name":"transformation","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-06T19:12:47Z","updated_at":"2015-03-07T16:11:49Z","closed_at":"2015-03-07T06:48:08Z","body":"Code:\r\n```js\r\nfunction* gen() {\r\n  yield 1;\r\n  yield 2;\r\n  yield 3;\r\n}\r\n\r\nfunction forOfSwitch() {\r\n  let rv = 0;\r\n  for(let a of gen()) {\r\n    switch(a) {\r\n      case 1: rv++; break;\r\n      case 2: rv++; break;\r\n      case 3: return rv;\r\n    }\r\n  }\r\n}\r\n\r\nfunction forOfIf() {\r\n  let rv = 0;\r\n  for(let a of gen()) {\r\n    if(a === 1) {\r\n      rv++;\r\n    } else if(a === 2) {\r\n      rv++;\r\n    } else if(a === 3) {\r\n      return rv;\r\n    }\r\n  }\r\n}\r\n\r\nalert(forOfSwitch() === forOfIf());\r\n```\r\n\r\n**Expected result**: it should alert `true`.\r\n**Actual result**: alerts `false`."},"comment":{"url":"https://api.github.com/repos/babel/babel/issues/comments/77695705","html_url":"https://github.com/babel/babel/issues/963#issuecomment-77695705","issue_url":"https://api.github.com/repos/babel/babel/issues/963","id":77695705,"user":{"login":"sebmck","id":853712,"avatar_url":"https://avatars.githubusercontent.com/u/853712?v=3","gravatar_id":"","url":"https://api.github.com/users/sebmck","html_url":"https://github.com/sebmck","followers_url":"https://api.github.com/users/sebmck/followers","following_url":"https://api.github.com/users/sebmck/following{/other_user}","gists_url":"https://api.github.com/users/sebmck/gists{/gist_id}","starred_url":"https://api.github.com/users/sebmck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebmck/subscriptions","organizations_url":"https://api.github.com/users/sebmck/orgs","repos_url":"https://api.github.com/users/sebmck/repos","events_url":"https://api.github.com/users/sebmck/events{/privacy}","received_events_url":"https://api.github.com/users/sebmck/received_events","type":"User","site_admin":false},"created_at":"2015-03-07T16:11:49Z","updated_at":"2015-03-07T16:11:49Z","body":"Fixed as of 4.7.2, thanks! Both of your examples work fine now."}}