tmcw/mistakes — pull request #5 by kirbysayshi (2013-02-05 23:44:08+00:00)
Title: Evaluate within function scopes!

I wanted to have content within functions be evaluated if possible too.
This is mostly a start, and it could be taken further.

With this code, the following will work:

var a = function(){
var f = 'what';	// undefined
f + 'who';	// "whatwho"
}

Function params throw a wrench, because the variables are never "reset".
For example:

var a = function(f){
f += 'what';	// "whatwhatwhatwhat"
f + 'who';	// "whatwhatwhatwhatwho"
}

The repeat happens every time the area is reevaluated. I thought about
scanning for args in the function, and then prepending 'f="default"' to
the eval'ed string. But it's impossible to know what to initialize them
with.

Thoughts?