Closed asez73 closed 9 years ago
Ok, thanks - I think I've got it.
Looks like it might get confused if you have multiple compiled functions and their results get returned out of order...
So if you've got just one function it should always be fine?
Yes it seems to be that: I spread the compiled functions amids the other uncompiled functions and used 'throttle send' and it works like a charm...
Ok fixed now - however it'll have to wait until the next time I push an IDE update before it's available (unless you install from GitHub).
So, I use some compiled javascript functions and get unpredictable results: a- the compiler is not accessible b- the complied code is rejected by the board and I get the non compiled javascript function c- the compiled code seems to be non functionnal, this creates some random behaviour later. d-the compiled code is apparently ok but the next javascript, uncompiled, function is ignored and not defined e- the IDE complains at upload time that some parenthesis are not closed... Which is impossible because those compiled functions are unchanged from one upload to the other and the IDE doesn't show any warning at the beginnig of any line.
Of course it also happens to work correctly but this is about 1/4th of the uploads. Commenting out "compiled" instructions does allow a correct execution of the code, just half the speed of compiled code.
The URL used for the compiler is "http://www.espruino.com:32766". The IDE is v0.56.1 but this happened with v0.56.0 too
The example below is the most common one.
Or also with throtte send, for exactly the same source code: This is just the same result actually, the functions in trouble seems to be randomly "selected".
Excerpt of the code in trouble