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
GM 4 Scripts Error: expected expression, got ')' #2670
Comments
The way the parsing works is to create a function for the userscript and then call it. The current implementation defines the script on a single line. If the userscript ends in a comment than it causes the function definition to be invalid. |
Submitted a pull to resolve the issue. |
Short term workaround: edit your scripts so they don't have a Will be fixed in next release. |
Obviously as pointed out in my initial post, I had already worked that out. ;) |
Sorry you edited that in after your first post, so I didn't see it (read the message as delivered to my email). |
Strange... since the edited post contains the data about it having a comment at the end. The original first post didn't have that information and only listed the error without showing the code. |
Todo me (or @Sxderp ?) add a unit test to ensure this issue doesn't regress in the future. |
Ah yes. I'll get on that. Submit as new pull request? If you want it in the same that'll be delaying the fix for a bit, unless you do it. Not sure when I can get around to the test cases[1]. [1] node and friends not setup |
Base pull is already merged. |
Added pull for tests |
Hi
Working scripts under GM 3 fail under GM 4
Any idea what the cause is?
Note: There is no JS error in the code. (tested)
After testing .... it seem the following fails
Fix: adding an extra line or removing the end comment eliminates the error.
The following works fine .... (added a blank line)
Following works as well ... (removed the end comment)
The text was updated successfully, but these errors were encountered: