@Gordon : That worked out perfectly, just what I needed: A couple of extra lines of code saved me about 100 variable blocks!! AND i can use long/descriptive variable & function names since the minifier is now free to do its magic!!
Anyone having "out of memory" issues should try this pattern:
var onInit = function(){
var aaa, bbb, ccc;
function one(){
}
function two(){
}
function three(){
}
//all your normal onInit code here
one();
delete onInit; //This is the key to saving memory
//onInit = unassigned; //also works
}
onInit();
I am now going to try it on a few of my modules to see if it helps there too.
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.
@Gordon : That worked out perfectly, just what I needed: A couple of extra lines of code saved me about 100 variable blocks!! AND i can use long/descriptive variable & function names since the minifier is now free to do its magic!!
Anyone having "out of memory" issues should try this pattern:
I am now going to try it on a few of my modules to see if it helps there too.