archives

« Bugzilla Issues Index

#2212 — Deprecation of arguments.callee makes functions not-quite first class


Hello,

I am filing this bug to draw attention to an unintended consequence of deprecating arguments.callee. I am hoping that this decision will be reversed OR an alternate method can be devised.

Functions in JavaScript are exceedingly powerful. Their first-class nature is of paramount importance to the language. Functions can be passed around with impunity and attributes can be defined upon them as appropriate. I believe the deprecation of arguments.callee without something to replace it will harm the expressivity and usefulness of the language.

The issue is that in removing arguments.callee, we lose the only method through which we can access a function’s attributes within the scope of that function.

This means that without arguments.callee ( or something that replaces it), functions will become ‘special cases’ as the only objects in JavaScript which have no way to access their own properties.


Simply give a name to your function. For example:

foo = function bar(x) { return bar.length }
foo() // => 1

(Note that there is some bug related to this feature in IE≤8.)


Bulk closing all Harmony bugs. Proposals should be tracked on GitHub. The ES wiki is completely defunct at this point.