jshint/jshint — Issue #329: Confusing "Bad for in variable" error.
Author: cowboy
Created: 2011-11-03 00:34:16+00:00
State: open

When I lint this at jshint.com:

```javascript
function foo(obj, prop) {
if (prop) {
obj[prop] = 1;
} else {
for (prop in obj) {
if (obj.hasOwnProperty(prop)) {
obj[prop] = true;
}
}
}
}
```

I get this error:

Line 5: for (prop in obj) {
Bad for in variable 'prop'.