-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"'hasOwnProperty' is a really bad name" #770
Comments
Yeah, that looks like a bug. We should warn about |
Hi, is there a way to suppress this warning? I'm using localstorage fallback from https://developer.mozilla.org/en-US/docs/DOM/Storage#localStorage (at the bottom of that section) which overwrites hasOwnProperty method. |
You can use |
I see. This is not scoped suppression, right? Also is there a way to turn warning back after /* jshint -W001 */? |
It is function scoped. |
We don't need to warn about 'var hasOwnProperty = ...' and such so now we only warn about the following cases: var obj = { hasOwnProperty: ... }; obj.hasOwnProperty = ...; obj['hasOwnProperty'] = ...; Closes jshintGH-770.
I was curious why JSHint has an error for:
When you're writing code like this:
... unless it's a leftover bug from the JSLint port:
http://tech.groups.yahoo.com/group/jslint_com/message/282
Is it something that can be fixed in an update? Or is there a better reason?
The text was updated successfully, but these errors were encountered: