Skip to content


Subversion checkout URL

You can clone with
Download ZIP


"self" is a reserved keyword #8

taitems opened this Issue · 7 comments

4 participants


Self is a reserved keyword, use _self instead.

As per:

@taitems taitems was assigned

Yep, I didn't think so. I remembered seeing it used throughout the jQuery code too.

Do a ctrl + f > "var self =" ...

Closing :)

@taitems taitems closed this

+1 on at least renaming it.

self isn't a reserved word but it is a native property of the window object in firefox/webkit. If you're referring to self and had forgotten to var scope it, it'll actually refer to the window object, which can make debugging difficult. It's for this reason that jQuery UI is pushing to rename instances of var self = this; (see )

@taitems taitems reopened this

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.

@taitems taitems closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.