History is cleared line-by-line, oldest first, when memory actually completely runs out. I think it may also be removed completely if a Flat String allocation is required and then fails.
I really think you're going down a rabbit hole here when I don't think there's any need though.
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.
Looks like GitHub is down right now so I can't point you to the exact points, but it's easy enough to search for
jsvGarbageCollect
.Specifically:
History is cleared line-by-line, oldest first, when memory actually completely runs out. I think it may also be removed completely if a Flat String allocation is required and then fails.
I really think you're going down a rabbit hole here when I don't think there's any need though.