{"issue":{"title":"Possible Bug with eqeqeq and eqnull","user":{"login":"claytoncarney","id":1275536,"url":"https://api.github.com/users/claytoncarney","avatar_url":"https://secure.gravatar.com/avatar/206efd99cb9eeb3190c919bbff7bfb31?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"206efd99cb9eeb3190c919bbff7bfb31"},"created_at":"2011-12-20T16:16:15Z","milestone":null,"labels":[{"name":"unconfirmed","url":"https://api.github.com/repos/jshint/jshint/labels/unconfirmed","color":"444444"}],"state":"open","updated_at":"2011-12-27T15:42:50Z","id":2614484,"closed_at":null,"html_url":"https://github.com/jshint/jshint/issues/390","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"Noticed something odd parsing jQuery (http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js) at jshint.com.\r\n\r\nYesterday, jshint reported so many eqeqeq errors that it stopped parsing at maxerr.\r\n\r\nToday, it seems to be missing most of them:\r\n\r\nA grep of the source reports 34 instances of /\\s==\\s/ (32 are /\\s==\\snull/), but jshint reports only 2 occurrences.\r\n\r\nA grep of the source reports 30 instances of /\\s!=\\s/ (27 are /\\s!=\\snull/), but jshint reports only 1 occurrence.\r\n\r\nI've also noticed that today the jshint string in the report is '/*jshin */', but yesterday it was something like '/*jshint forin:true, noarg:true, noempty:true, eqeqeq:true, bitwise:true, strict:true, undef:true, curly:true, browser:true, indent:4, maxerr:50 */'.\r\n\r\nThis is my second day with jshint, so it could be me. Can anyone else confirm this problem?\r\n\r\n","number":390,"url":"https://api.github.com/repos/jshint/jshint/issues/390","comments":8,"assignee":null},"comment":{"user":{"login":"claytoncarney","id":1275536,"url":"https://api.github.com/users/claytoncarney","avatar_url":"https://secure.gravatar.com/avatar/206efd99cb9eeb3190c919bbff7bfb31?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"206efd99cb9eeb3190c919bbff7bfb31"},"created_at":"2011-12-27T15:42:50Z","updated_at":"2011-12-27T15:42:50Z","id":3282323,"body":"**UPDATE**\r\n\r\nI traced down the area in the jquery source that was causing the error. Again, I must emphasize that the problem **only** occurs with jshint.js on jshint.com, **not** the latest jshint.js from Git.\r\n\r\n**Concise Problem Statement**\r\n\r\nWhen forin:true is specified and jshint encounters a for...in statement with and empty block, it gets confused and appears to terminate normal parsing, although it does not appear to throw an exception.\r\n\r\n**Demonstrative Examples**\r\n\r\nRunning this simplified example at jshint.com with all options unchecked:\r\n\r\n````\r\n/*jshint eqeqeq: true, forin: true */\r\nfunction test( obj ) {\r\n    var key, temp;\r\n    for ( key in obj ) {}\r\n\r\n    return key === undefined || hasOwn.call( obj, key );\r\n}\r\n````\r\nThe report shows a mangled /*jshin */ string and a meaningless 'Line 6: s is undefined' error. However, eliminating the empty block:\r\n\r\n````\r\n/*jshint eqeqeq: true, forin: true */\r\nfunction test( obj ) {\r\n    var key, temp;\r\n    for ( key in obj ) {temp = key;}\r\n\r\n    return key === undefined || hasOwn.call( obj, key );\r\n}\r\n````\r\nThe report correctly identifies a forin error on Line 4.","url":"https://api.github.com/repos/jshint/jshint/issues/comments/3282323"},"action":"created"}