Some tricks I had to do to recover a class object definition from a saved one on a running Espruino Pico #1277
Replies: 3 comments
-
Posted at 2019-01-15 by @gfwilliams That's great - a really neat. There's a lot of data hanging around inside Espruino that So the issue is you have something like this?
Potentially that is something I could fix in Espruino - maybe by detecting that no top-level name has been found and by making a temporary name to use? I know I'll make a note about this in this long-standing bug. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-15 by asez73 Hi, Indeed I deleted the source code in the editor (right side pane) and stupidly saved that incomplete source code to my PC without noticing what had disappeared. Could we get versionning every time we save a source, maybe just renaming the previous same named file with an added time stamp automatically? The joined file contains that whole thing in terms of: what the little trick gave from the running source on the Espruino, what I finally got after re-editing this dump to get a new version of the source. Eventually, some improvements on the editor side would be nice too: something like "Do you want to delete the lines selected" when there are many of them. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2019-01-16 by @gfwilliams Ahh - sorry, I should have checked your attached file. That's much clearer. It's odd actually because if
Annoyingly I don't think the Chrome app can do that - maybe it could manage with the 'projects' feature, but it definitely wouldn't work with the online version in the web browser :( I think realistically the best method would some kind of Git integration as on http://forum.espruino.com/conversations/296367/#comment14577373 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2019-01-15 by asez73
Hi,
I would like to share this as I had some difficulties some weeks ago and got out of trouble using this:
Here is a recipe to extract the class definition of an object in the console pane.
I used it on a running Espruino Pico which had an objet stopwatch.runningOnStats saved but could not get its source defintion from dump().
It was no more available in the WebIde editor pane because I had wiped it and saved without seeing this before... So I had lost all of the source code for the class runningOnStats property of stopwatch
In the following case, stopwatch.runningOnStats is the object which we want to get the defintion on the console.
We will have to copy/paste/edit the result from the console to get it in a source form
The attached file is a more explicit result and execution trace of what this gave to me.
Attachments:
Beta Was this translation helpful? Give feedback.
All reactions