{"issue":{"title":"Body of a for-in","user":{"login":"roderickObrist","id":935342,"url":"https://api.github.com/users/roderickObrist","avatar_url":"https://secure.gravatar.com/avatar/cab35a44fb3d93a54e3012b40d40221b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cab35a44fb3d93a54e3012b40d40221b"},"created_at":"2011-12-29T03:52:34Z","milestone":null,"labels":[],"state":"closed","updated_at":"2011-12-29T03:55:49Z","id":2677053,"closed_at":"2011-12-29T03:55:49Z","html_url":"https://github.com/douglascrockford/JSLint/issues/93","pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"body":"I keep looking at this code wondering where I went wrong, but I cant see it.\r\n\r\n```ruby\r\n/*global Form*/\r\nForm.prototype.toHTTPString = function () {\r\n\t\"use strict\";\r\n\tvar fields = this.fields,\r\n\t\tgetString = '',\r\n\t\ti;\r\n\tfor (i in fields) {\r\n\t\tif (fields.hasOwnProperty(i)) {\r\n\t\t\tgetString += (i + '=' + encodeURIComponent(fields[i].elm.attr('value')));\r\n\t\t}\r\n\t\tgetString += '&';\r\n\t}\r\n\treturn getString.slice(0, -1);\r\n};\r\n```\r\n\r\nIf you copy and paste that into JSlint it spits out:\r\n\r\nError:\r\n\r\nProblem at line 7 character 5: The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype.\r\n\r\nIf this is not a bug, and I'm just plain blind you have my apologies in advance.","number":93,"url":"https://api.github.com/repos/douglascrockford/JSLint/issues/93","comments":0,"assignee":null},"action":"closed"}