am I right to say that an instance of a function object is immutable since there's no way we could modify a function once its created?
Anyway, to rephrase my question:
var f1=function(){
return true;
}
//Now i pass **f1** into the function **G**, storing it to **g1**
function G(f){
return function(){
return f();
}
}
var g1=G(f1);
//I will try to hack/do anything i can to **f1**
//Now i will pass f1 to hacked piece of injection code which (assumingly) will try to hack f1
g1(); // but I can be 100% sure this will still return me true
So now can I be sure that no matter what I do to f1, g1() will Forever return me true ?
Despite being interested in browsers with at least 0.5% of the internet users market share: I welcome answers that goes along the lines of "in [x] browser this is not safe because.."
I am aware that since the code is run at the client, if the client has a malicious intent he will be able to do whatever he want.. But this question is specifically targeted at protecting "users who do not have malicious intents", in other words.. a normal user (if the user is a hacker than i don't mind letting him mess with the functions anyway he wants since he'd get all the exceptions thrown in his face and that's none of my business)