Comment #3 on issue 1548 by erights: The 'caller' and 'arguments'
properties on built-in functions can't be neutered.
http://code.google.com/p/v8/issues/detail?id=1548
I wonder what would break if these properties were simply absent?
Having these properties be absent on built-ins would be ideal. As for what
would break, from what I can tell, these are already absent on Safari and
WebKit Nightly.
'caller' in {}.valueOf; // false
And just in case 'caller' is magical enough to miss showing up in 'in', try
function testfn(f) { return [1].map(f)[0]; }
function foo() { return [].map.caller; }
testfn(foo);
That last call to testfn returns undefined on Safari and WebKit nightly. It
returns null on FF and FF Nightly -- not sure what's going on there, but at
least it doesn't seem to be unsafe. And FWIW, it returns null on Opera.
So safety, WebKit/JSC compatibility, ES recommendation/best practices, the
lack of problems that these other browsers experience with absence, and
possible simplification or optimization opportunities down the road all
argue that absence would be a great choice. Thanks for raising this
possibility!
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev