There seems to be some asymmetry in prototype pollution between functions and “plain”1 objects:
var a = {}
function foo(){}
a.__proto__.something = 32;
foo.__proto__.bar = 67;
console.log(a.bar) // <--- not polluted
console.log(foo.something) // <--- polluted
- The example shows that plain objects can pollute functions
- Is the other way around possible too? (functions polluting plain objects)
1 terminology is not a consensus (see here)