It's because when code is sent to Espruino it is executed as if you typed it in. If there is a newline at root scope and the statement by itself is complete then it is executed.
It's done so it can execute more code than could actually be fitted into memory.
Basically I've had to manually add hacks for the common ways people do strange formatting, but there are obviously a few ways I haven't covered.
Just write code in the 'normal' coding style and it'll be fine. Would be good if you could file a bug on the Web IDE github for this though.
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.
It's because when code is sent to Espruino it is executed as if you typed it in. If there is a newline at root scope and the statement by itself is complete then it is executed.
It's done so it can execute more code than could actually be fitted into memory.
Basically I've had to manually add hacks for the common ways people do strange formatting, but there are obviously a few ways I haven't covered.
Just write code in the 'normal' coding style and it'll be fine. Would be good if you could file a bug on the Web IDE github for this though.