-
Notifications
You must be signed in to change notification settings - Fork 101
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
"self" is a reserved keyword #8
Comments
self is not a reserved keyword. see https://developer.mozilla.org/en/JavaScript/Reference/Reserved_Words |
Yep, I didn't think so. I remembered seeing it used throughout the jQuery code too. http://code.jquery.com/jquery-1.6.js Do a ctrl + f > "var self =" ... Closing :) |
+1 on at least renaming it.
|
Thank you for this, re-opening the issue for consideration. |
while self is not a reserved keyword, @ehynds makes a good point. You could possibly go for something like _self unless that conflicts with Underscore.js naming conventions. |
These front-end guidelines should not be promoting leaking globals at all. It would be the same as saying you cannot use the word frames in your code since it conflicts with a property on the window object. _self looks ugly and is unnecessary. Perhaps just discuss the fact that self is a property on the window object and if you leak it globally it will override... and that you shouldn't be leaking a word to describe something internal anyways. My 2 cents. |
Fixed locally, pending commit. |
Self is a reserved keyword, use _self instead.
As per: http://news.ycombinator.com/item?id=2519614
The text was updated successfully, but these errors were encountered: