3 ms·
Why don't you prefix variables based on their usage in the code? function(a,b,c) -> function(arg1_cat, arg2_tree, arg3_carrot) for(i=0; i< 10; i++) -> for(cou
by billyhoffman 13y ago
Why don't you prefix variables based on their usage in the code?
function(a,b,c) -> function(arg1_cat, arg2_tree, arg3_carrot)
for(i=0; i< 10; i++) -> for(counter1=0; counter1 < 10; counter1++)
var a -> var global_pants;
You could do this reasonably well with regular expressions/find+replace.
To be more sophisticated you would use a a tokenizer/parser and rename based on the identifiers location in the AST nodes. I did something similar a few years ago for a commercial product that included a JavaScript beautifier and our customers loved it.