-
Notifications
You must be signed in to change notification settings - Fork 711
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
Line number error [SPOILER] #295
Comments
In fact, I'm pretty sure this solution is valid Javascript. Not sure why it is generating so many parse errors. Also, the parse errors seem inconsistent. Also, I did this solution to run once, but it appears to crash on me.move(). (difficult to debug though)
|
I'm taking a look at this now, but it may take some time to get to the bottom of this. |
It might be due to wrongly used curly brackets in new line. in functions, if's, for's and so on. function name() { not function name()
{ As this can make errors with silent semicolons (or however its called); |
From my understanding, Automatic Semicolon Insertion shouldn't occur during
should evaluate the same as
If he was doing this with
|
I know i had several problems with it, also with different browsers - from that time, i always use proper {} in this language so no errors of this kind would ever happend to me. And i also think, that if you can fix something, you should - then error you had can (at least) point to its proper place not some random ones. |
Placing the brace on a new line is called Allman Style and is a valid style of indenting as long as you are consistent and avoid ASI issues like I mentioned above. Personally, I prefer OTBS but using Allman style should not create a syntax error. More info on the "holy war" here. |
Your code is valid JavaScript, but it doesn't adhere to Untrusted's 80-character-per-line limit, so some lines get split up when you paste it into the game. This seems to be the cause of most of your problems. For example, the [Line 62] error is actually caused by invalid syntax on line 67: The line numbers in the errors are sometimes wrong, which is a problem. However, I'm not sure if there's a good way to fix this, because we're currently getting these line numbers in an extremely fragile way (since JavaScript itself does not provide line numbers for exceptions that occur when you |
I'm getting syntax errors, but the error doesn't make sense for the given line number, and I'm pretty sure it is not a syntax error.
The text was updated successfully, but these errors were encountered: