You are reading a single comment by @Robin and its replies.
Click here to read the full conversation.
-
Wed 2021.10.27
'Looks like global variables named c are a no-go in Espruino 2v10'
I believe there are several/many others as I demonstrated in several code block examples over 18 months ago:
http://forum.espruino.com/conversations/346667/#comment16244096
Those should provide useful for eliminating the other letters of the alphabet.
I've just dug a little deeper and I can reproduce even on a desktop build with:
Turns out it's not a memory corruption issue or anything like that (although the
Field or method "testuQÃ¥"
error does seem ominous). It's to do with how the code formenu.move
was minified.The function (after minification, and with some semblance of formatting added) is:
Unminified code is:
I guess it's valid JS, but what the minifier has done is change all variable names to
c
, and then it has just a singlevar c
in the firstif
statement, and nowhere else. So if thatif
doesn't get run in Espruino, no local var is created and it assumes that the var is global, overwritingc
.So in short:
c
are a no-go in Espruino 2v10