{"action":"closed","issue":{"url":"https://api.github.com/repos/jshint/jshint/issues/2250","labels_url":"https://api.github.com/repos/jshint/jshint/issues/2250/labels{/name}","comments_url":"https://api.github.com/repos/jshint/jshint/issues/2250/comments","events_url":"https://api.github.com/repos/jshint/jshint/issues/2250/events","html_url":"https://github.com/jshint/jshint/issues/2250","id":60730503,"number":2250,"title":"JSHint error when parsing a for in loop that contains an if statement that's missing parens","user":{"login":"kzsh","id":1041312,"avatar_url":"https://avatars.githubusercontent.com/u/1041312?v=3","gravatar_id":"","url":"https://api.github.com/users/kzsh","html_url":"https://github.com/kzsh","followers_url":"https://api.github.com/users/kzsh/followers","following_url":"https://api.github.com/users/kzsh/following{/other_user}","gists_url":"https://api.github.com/users/kzsh/gists{/gist_id}","starred_url":"https://api.github.com/users/kzsh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzsh/subscriptions","organizations_url":"https://api.github.com/users/kzsh/orgs","repos_url":"https://api.github.com/users/kzsh/repos","events_url":"https://api.github.com/users/kzsh/events{/privacy}","received_events_url":"https://api.github.com/users/kzsh/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jshint/jshint/labels/cannot%20reproduce%20or%20not%20an%20issue","name":"cannot reproduce or not an issue","color":"000000"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-11T21:12:47Z","updated_at":"2015-07-05T07:22:31Z","closed_at":"2015-07-05T07:22:31Z","body":"node version: v0.10.33\r\njshint version: jshint@2.6.3\r\nOriginally discovered with: jshint@2.5.10\r\nidentical error for both versions.\r\n\r\nCode that triggered the error (note the missing parens on the `if` in the `for in`):\r\n\r\n    var myObj = {};\r\n    for(foo in this.bars) {\r\n        if this.bars.hasOwnProperty(foo) {\r\n            myObj[foo] = this.bars[foo];\r\n        }\r\n    }\r\nStack trace in v2.6.3:\r\n\r\n    /usr/local/lib/node_modules/jshint/src/jshint.js:5432\r\n            throw err;\r\n                ^\r\n    TypeError: Cannot read property 'type' of undefined\r\n        at Object.oldScope [as fud] (/usr/local/lib/node_modules/jshint/src/jshint.js:3822:15)\r\n        at expression (/usr/local/lib/node_modules/jshint/src/jshint.js:897:32)\r\n        at statement (/usr/local/lib/node_modules/jshint/src/jshint.js:1599:9)\r\n        at statements (/usr/local/lib/node_modules/jshint/src/jshint.js:1642:16)\r\n        at block (/usr/local/lib/node_modules/jshint/src/jshint.js:1761:13)\r\n        at Object.blockstmt.labelled [as fud] (/usr/local/lib/node_modules/jshint/src/jshint.js:4177:11)\r\n        at expression (/usr/local/lib/node_modules/jshint/src/jshint.js:897:32)\r\n        at statement (/usr/local/lib/node_modules/jshint/src/jshint.js:1599:9)\r\n        at statements (/usr/local/lib/node_modules/jshint/src/jshint.js:1642:16)\r\n        at block (/usr/local/lib/node_modules/jshint/src/jshint.js:1761:13)\r\n\r\nIn case it helps here's the stack trace in v2.5.10:\r\n\r\n    /usr/local/lib/node_modules/jshint/src/jshint.js:5271\r\n            throw err;\r\n                ^\r\n    TypeError: Cannot read property 'type' of undefined\r\n        at Object.oldScope [as fud] (/usr/local/lib/node_modules/jshint/src/jshint.js:3741:15)\r\n        at expression (/usr/local/lib/node_modules/jshint/src/jshint.js:1057:32)\r\n        at statement (/usr/local/lib/node_modules/jshint/src/jshint.js:1745:9)\r\n        at statements (/usr/local/lib/node_modules/jshint/src/jshint.js:1788:16)\r\n        at block (/usr/local/lib/node_modules/jshint/src/jshint.js:1907:13)\r\n        at Object.blockstmt.labelled [as fud] (/usr/local/lib/node_modules/jshint/src/jshint.js:4096:11)\r\n        at expression (/usr/local/lib/node_modules/jshint/src/jshint.js:1057:32)\r\n        at statement (/usr/local/lib/node_modules/jshint/src/jshint.js:1745:9)\r\n        at statements (/usr/local/lib/node_modules/jshint/src/jshint.js:1788:16)\r\n        at block (/usr/local/lib/node_modules/jshint/src/jshint.js:1907:13)"}}