I would expect that each name be different, should the attribute be specific to a function.
I don't think you're understanding - \xFFcod is basically a field inside the function object. So every function has its own one. The choice of string/flatstring depends on what was seemed most efficient to Espruino when it was defined.
trace("history")
Again, I don't think you really took in what I said previously. You just defined a String with contents history and you're outputting that, not what was called history.
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.
I don't think you're understanding -
\xFFcod
is basically a field inside the function object. So every function has its own one. The choice of string/flatstring depends on what was seemed most efficient to Espruino when it was defined.Again, I don't think you really took in what I said previously. You just defined a String with contents
history
and you're outputting that, not what was called history.If you want history, you look at:
And go back down the trace output, using the name in the lines above:
Espruino doesn't support that syntax.
A few lines earlier you did
typeof global
and found it was an object. Objects don't haveforEach
.Object.keys(global).forEach(name=> ...);
is fine thoughYes, it prints.
Ok, so there's what I mentioned above with
history
.So let's say you're after
637
... I've copied your trace contents below, but have removed any lines of the same indenting to make it clearer.So now, you just work back. You can see
\xffcod
thendl
then you're back at the global object, so: