In Javascript, is there a way to create a function from a string (such as through the new Function() constructor) and have it inherit the parent scope? For example:
(function(){
function yay(){
}
var blah = "super yay"
yay.prototype.testy = new Function("alert(blah)")
yay.prototype.hello = function(){alert(blah)}
whee = new yay();
whee.hello()
whee.testy()
})()
Is there any way to make whee.testy() also alert "super yay"?