{"action":"created","issue":{"url":"https://api.github.com/repos/SonarSource/SonarJS/issues/885","repository_url":"https://api.github.com/repos/SonarSource/SonarJS","labels_url":"https://api.github.com/repos/SonarSource/SonarJS/issues/885/labels{/name}","comments_url":"https://api.github.com/repos/SonarSource/SonarJS/issues/885/comments","events_url":"https://api.github.com/repos/SonarSource/SonarJS/issues/885/events","html_url":"https://github.com/SonarSource/SonarJS/issues/885","id":281781755,"number":885,"title":"S3827 Raise Wrong \"Non-existent variables\" errors from for..of loops","user":{"login":"AMorgaut","id":49318,"avatar_url":"https://avatars0.githubusercontent.com/u/49318?v=4","gravatar_id":"","url":"https://api.github.com/users/AMorgaut","html_url":"https://github.com/AMorgaut","followers_url":"https://api.github.com/users/AMorgaut/followers","following_url":"https://api.github.com/users/AMorgaut/following{/other_user}","gists_url":"https://api.github.com/users/AMorgaut/gists{/gist_id}","starred_url":"https://api.github.com/users/AMorgaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AMorgaut/subscriptions","organizations_url":"https://api.github.com/users/AMorgaut/orgs","repos_url":"https://api.github.com/users/AMorgaut/repos","events_url":"https://api.github.com/users/AMorgaut/events{/privacy}","received_events_url":"https://api.github.com/users/AMorgaut/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-13T15:06:35Z","updated_at":"2017-12-13T15:08:07Z","closed_at":null,"author_association":"NONE","body":"**I want to report a bug.**\r\n\r\n**SonarJS version:** 3.3.0.5702<br>\r\n**SonarQube version:** 5.6.7<br>\r\n\r\n**Rule key:** S3827\r\n--\r\n\r\nRaise an error saying variables do not exist while they do\r\nThe issue happens when using **destructuring** in **for..of** loops\r\n\r\n**Reproducer** \r\n```javascript\r\nconst baz = [1,2]\r\nconst target = 1;\r\nfor (const [foo, bar] of baz) {\r\n    if (foo === target) {\r\n       return bar;\r\n    }\r\n}\r\n```\r\noutputs:\r\n\r\n* \"connection\" doest not exists\r\n* \"hash\" does not exists\r\n\r\n**Expected behavior**\r\n\r\nShould not raise error as foo and bar exist\r\n"},"comment":{"url":"https://api.github.com/repos/SonarSource/SonarJS/issues/comments/351418522","html_url":"https://github.com/SonarSource/SonarJS/issues/885#issuecomment-351418522","issue_url":"https://api.github.com/repos/SonarSource/SonarJS/issues/885","id":351418522,"user":{"login":"vilchik-elena","id":10108186,"avatar_url":"https://avatars1.githubusercontent.com/u/10108186?v=4","gravatar_id":"","url":"https://api.github.com/users/vilchik-elena","html_url":"https://github.com/vilchik-elena","followers_url":"https://api.github.com/users/vilchik-elena/followers","following_url":"https://api.github.com/users/vilchik-elena/following{/other_user}","gists_url":"https://api.github.com/users/vilchik-elena/gists{/gist_id}","starred_url":"https://api.github.com/users/vilchik-elena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vilchik-elena/subscriptions","organizations_url":"https://api.github.com/users/vilchik-elena/orgs","repos_url":"https://api.github.com/users/vilchik-elena/repos","events_url":"https://api.github.com/users/vilchik-elena/events{/privacy}","received_events_url":"https://api.github.com/users/vilchik-elena/received_events","type":"User","site_admin":false},"created_at":"2017-12-13T15:08:07Z","updated_at":"2017-12-13T15:08:07Z","author_association":"CONTRIBUTOR","body":"@AMorgaut Did you mistyped variable names in output?"}}
{"actor":{"display_login":"vilchik-elena"}}