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.
var foo = `console.log('This is "cool".');`;
var bar =`Line1
Line2`;
//storage.write, storage.read
eval(foo);
console.log(bar);
A workaround would be var foo = 'console.log("This is \\\"cool\\\".");'; and bar="Line1\nLine2", but that's hard to write. What's the cause of this error?
Strange, works for me with 71.3.
Do you have minification turned on? Esprima (offline) doesn't like the ` character: "TypeError: Cannot read property 'length' of undefined". Online (closure compiler) minification works.
Try upgrading to the latest web ide :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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?