Skip to content

Using reserved-words for var or property names should assert #60

Closed
rkettering opened this Issue Jul 29, 2012 · 4 comments

2 participants

@rkettering
Frogatto & Friends member

Since before 1.0, we've used "vars.active" to flag whether fans are running or not. Very recently, something has caused this to conflict with the built-in boolean "active", indicating whether an object is being processed or not. All the fans in the fan house broke.

It'd be nice if all usage of reserved-words was strictly forbidden and asserted on by the engine, because we've had several problems with this which have been messy to track down.

@DDR0
Frogatto & Friends member
DDR0 commented Jul 29, 2012

Personally, this problem is usually introduced by yours truly forgetting to query or set 'vars.active' instead of 'active' in one or two places. I'm not really sure how we could catch this case. :/

@rkettering
Frogatto & Friends member

I'm asking that vars.active be illegal - i.e. that reserved words, which are now legal for use in vars/properties when properly prefixed, become illegal. Because they tend to just be a rats-nest of problems, and it's not hard to use something else.

@DDR0
Frogatto & Friends member
DDR0 commented Jul 31, 2012

I'd second this. I've had problems caused by it.

@rkettering
Frogatto & Friends member

Has been recently fixed as part of the strict mode conversion - strict mode won't let you use a property name that collides with the name of a built-in.

@rkettering rkettering closed this Dec 24, 2013
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.