Ye olde arguments argument (was: Topic list - pending changes and issues for the ES3.1 spec)

William Edney bedney at technicalpursuit.com
Fri Sep 12 14:36:48 PDT 2008


Oops, I meant this for the whole list:

Brendan -

We long ago gave up on having arguments.caller (queue sound effect for  
"wailing and gnashing of teeth"). As I remember, there was a lack of  
desire to keep it in Mozilla after security problems around calling  
web content from chrome JS. Of course, we always thought this fix was  
a bit extreme and could've been handled in another way (i.e. not allow  
web content to access 'caller' if it was calling into chrome - throw a  
security exception or something). Anyway, IE's JScript kept this  
property (and you implemented arguments.callee.caller, which you can  
explain better here than I can ;-), and was sufficient for our  
debugging needs - although it crippled us a bit as to what we really  
wanted to accomplish - but that's life :-).

However, having '.callee' support, or equivalent, is absolutely  
crucial moving forward. We don't tend to use it as originally intended  
(although its really nice to be able to have a reference to an  
anonymous function without an outside reference). We do things like:

foo = function ()
{
	bar(arguments);
}

bar = function (theArgs)
{
	alert('You came from: ' + theArgs.callee.toString());
}

Removing 'callee' with no substitute that can supply similar  
functionality would be very crippling indeed.

Cheers,

- Bill

On Sep 11, 2008, at 12:34 PM, Brendan Eich wrote:

> The TIBET guys would want a replacement for arguments.caller, but I
> would not miss it. But it's not in ES3 at all, right? Ban all such
> caller variations in strict mode, I say!
>



More information about the Es-discuss mailing list