[Resurrection] Make Function.length Configurable

# Jeremy Martin (12 years ago)

This is a resurrection of an earlier proposal from Nathan Wall, that would make Function.length configurable. The initial proposal was to make it writable, but configurable instead was suggested by Claude Pache.

Nathan's original post does a good job of outlining the motivation, so I won't reiterate them here. From what I can gather, making Function.length configurable seemed to receive a positive response 3, 4, 5, but the thread apparently died. Perhaps I just need to find a new API paradigm, but I run into this issue on a regular basis writing callback utilities, and would be very interested in seeing this move forward.

For convenience, the Function.length spec from the latest draft:

This is a data property with a value of 1. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.

# Jeremy Martin (12 years ago)

I referenced Function.length instead of Function#length. Here's the actually relevant spec:

The value of the length property is an integer that indicates the typical number of arguments expected by the function. However, the language permits the function to be invoked with some other number of arguments. The behaviour of a function when invoked on a number of arguments other than the number specified by its length property depends on the function. This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.

Everything else still applies. (Hopefully) goes without saying, but the same should apply to GeneratorFunction instances as well.

# Jeremy Martin (12 years ago)

An offline discussion with RW identified this as a spec bug. Filed here: ecmascript#1587

# Brendan Eich (12 years ago)

Thanks for keeping after this!

# Rick Waldron (12 years ago)

On Wed, Jul 17, 2013 at 12:17 PM, Jeremy Martin <jmar777 at gmail.com> wrote:

An offline discussion with RW identified this as a spec bug. Filed here: ecmascript#1587

Thanks again!

(I see that Allen has already fixed this :D)

# Jeremy Martin (12 years ago)

No problem - I've enjoyed getting a glimpse into how this process works!