Skip to content
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

Add better error for '=+' typo #164

Open
sderickson opened this issue Jun 3, 2016 · 1 comment
Open

Add better error for '=+' typo #164

sderickson opened this issue Jun 3, 2016 · 1 comment

Comments

@sderickson
Copy link
Contributor

from @alexholman, copied from codecombat/codecombat#3710

Related to my initial issue report: codecombat/codecombat#3709
I found my problem was typing =+ instead of += for an increment, resulting in an infinite loop condition.

This is not a very informative error for this easy typo. The code should catch the use of =+ and warn, much like it catches capitalization issues in object names and missing ':' in loops.

@UltCombo
Copy link
Contributor

I guess most of you already know this, but a problem is that =+ is actually valid syntax. For example, in JavaScript:

var x = '5';
x=+x; // Convert string to number
hero.say(typeof x); // number
hero.say(x); // 5

But still, maybe Aether can show a custom JSHint warning for this specific construct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants