Unexpected token ILLEGAL #6172
Replies: 1 comment
-
Posted at 2019-08-04 by AkosLukacs Strange, works for me with 71.3. Posted at 2019-08-04 by Robin Sun 2019.08.04 Strings are delimited with the double quote Json name/value values and Html attributes delimited with the single quote That character is the grave accent. Proper usage as you require explained in detail by @allObjects Single quotes go inside a double quoted string, *(unless escaped as you show)* not double embedded in a single quoted string.
Posted at 2019-08-04 by maze1980
Hit. Without Esprima it works fine. Thanks! Posted at 2019-08-05 by @gfwilliams Any chance of using a newer IDE version? If you installed the Chrome web app it should have updated to 0.71.3 weeks ago - I updated to a newer Esprima version some time ago which handles that fine. I guess you're on the native download? I've just updated that to the latest version now - but if you can use it the chrome app is preferable since it auto-updates. Posted at 2019-08-05 by maze1980 I'm fine with the bug, I don't need any minfication in this case (it won't modify the contents of that string anyway). In 0.71.4 it says for Posted at 2019-08-05 by @gfwilliams
I know, that's a bit odd, but it still seems to work? Posted at 2019-08-05 by maze1980 Yes, it seems to work. But I tested only simple, single strings. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-08-04 by maze1980
My code:
If I paste it on the left side of the IDE (Web IDE version 0.70.6) it works fine, if I try to upload it from the edit panel it gives the error message "Error: Line 1: Unexpected token ILLEGAL".
I'm using more complex strings also containing both single and double quotes, e.g.
A workaround would be
var foo = 'console.log("This is \\\"cool\\\".");';
andbar="Line1\nLine2"
, but that's hard to write. What's the cause of this error?Beta Was this translation helpful? Give feedback.
All reactions