-
Yes I did the dev that way. I mean load only a part of the code and check it's functionnalities.
However some bugs appeared since I tried to shrink down my code and changed it again.
The problem arrises due to the fact that not all the source code can be loaded at once, even without launching anything. It has to be partly executed before the remaining part of the code is evaluated.A complementary need would be to use more than one source file from the webide, having a 3rd window so that I could choose what to upload easily. That's not a priority, I agree.
The real solution is elsewhere: Use some code from flash directly, which, i guess, is on the trend of the ESP8266 and partly answered in some other discussion.
@asez73 I think that's pretty low down my priority list at the moment I'm afraid. Can you not just upload only the code that is giving you problems, and then run that with a Timeout in order to debug?
Once the problem is solved, you can move to full code...
But actually thinking about it - I don't see why a timeout makes your code use more memory? It'd still run as usual, do the calculations, and remove everything from memory (including the timeout) leaving you in exactly the same state.
@allObjects a source map is an interesting idea... when a function is defined, Espruino could report back the 'JsVar ID', and the Web IDE could make a note of it in reference to the line number. Then, when debugging it could output
JsVar ID+line+col
and the Web IDE could work back.Espruino might be able to store a line number for each function, but I'm not sure whether functions in functions could get line numbers without being too slow.
Of course as Espruino prints the whole line of text, the Web IDE could just search and match that line? There might be duplicates sometimes, but the most times it'd be able to figure out where it was.