That's great - a really neat. There's a lot of data hanging around inside Espruino that dump() doesn't reconstruct properly.
So the issue is you have something like this?
function Test() {
console.log("Hello");
}
Test.prototype.foo = function() {
console.log("Hello 2");
};
a = new Test();
delete Test; // we've now lost the original 'Test'
dump();
// outputs just:
// var a = Object.create(a.__proto__.constructor["prototype"]);
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 dump() isn't that smart at recreating objects.
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.
That's great - a really neat. There's a lot of data hanging around inside Espruino that
dump()
doesn't reconstruct properly.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
dump()
isn't that smart at recreating objects.I'll make a note about this in this long-standing bug.