[Resurrection] Make Function.length Configurable
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.
I referenced Function.length instead of Function#length. Here's the actually relevant spec [1]: 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 [2]. [1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.4.1 [2] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.19.3.4 On Tue, Jul 16, 2013 at 3:53 PM, Jeremy Martin <jmar777 at gmail.com> wrote: > This is a resurrection of an earlier proposal from Nathan Wall [1], that > would make Function.length configurable. The initial proposal was to make > it writable, but configurable instead was suggested by Claude Pache [2]. > > Nathan's original post [1] 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 [6]: > > This is a data property with a value of 1. This property has the > attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: > false }. > > > [1] http://www.mail-archive.com/[email protected]/msg21786.html > [2] http://www.mail-archive.com/[email protected]/msg21792.html > [3] http://www.mail-archive.com/[email protected]/msg21793.html > [4] http://www.mail-archive.com/[email protected]/msg21794.html > [5] http://www.mail-archive.com/[email protected]/msg21795.html > [6] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.2.2 > > Thanks, > > -- > Jeremy Martin > 661.312.3853 > http://devsmash.com > @jmar777 > -- Jeremy Martin 661.312.3853 http://devsmash.com @jmar777 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130716/917d5b4c/attachment.html>
An offline discussion with RW identified this as a spec bug. Filed here: ecmascript#1587
An offline discussion with RW identified this as a spec bug. Filed here: https://bugs.ecmascript.org/show_bug.cgi?id=1587 On Tue, Jul 16, 2013 at 4:08 PM, Jeremy Martin <jmar777 at gmail.com> wrote: > I referenced Function.length instead of Function#length. Here's the > actually relevant spec [1]: > > 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 [2]. > > [1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.4.1 > [2] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.19.3.4 > > > On Tue, Jul 16, 2013 at 3:53 PM, Jeremy Martin <jmar777 at gmail.com> wrote: > >> This is a resurrection of an earlier proposal from Nathan Wall [1], that >> would make Function.length configurable. The initial proposal was to make >> it writable, but configurable instead was suggested by Claude Pache [2]. >> >> Nathan's original post [1] 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 [6]: >> >> This is a data property with a value of 1. This property has the >> attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: >> false }. >> >> >> [1] http://www.mail-archive.com/[email protected]/msg21786.html >> [2] http://www.mail-archive.com/[email protected]/msg21792.html >> [3] http://www.mail-archive.com/[email protected]/msg21793.html >> [4] http://www.mail-archive.com/[email protected]/msg21794.html >> [5] http://www.mail-archive.com/[email protected]/msg21795.html >> [6] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.2.2 >> >> Thanks, >> >> -- >> Jeremy Martin >> 661.312.3853 >> http://devsmash.com >> @jmar777 >> > > > > -- > Jeremy Martin > 661.312.3853 > http://devsmash.com > @jmar777 > -- Jeremy Martin 661.312.3853 http://devsmash.com @jmar777 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130717/5daabb77/attachment.html>
Thanks for keeping after this!
Thanks for keeping after this! /be Jeremy Martin wrote: > An offline discussion with RW identified this as a spec bug. Filed > here: https://bugs.ecmascript.org/show_bug.cgi?id=1587 > > On Tue, Jul 16, 2013 at 4:08 PM, Jeremy Martin <jmar777 at gmail.com > <mailto:jmar777 at gmail.com>> wrote: > > I referenced Function.length instead of Function#length. Here's > the actually relevant spec [1]: > > 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 [2]. > > [1] > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.4.1 > <http://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-15.3.4.1> > [2] > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.19.3.4 > <http://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-15.19.3.4> > > > On Tue, Jul 16, 2013 at 3:53 PM, Jeremy Martin <jmar777 at gmail.com > <mailto:jmar777 at gmail.com>> wrote: > > This is a resurrection of an earlier proposal from Nathan Wall > [1], that would make Function.length configurable. The > initial proposal was to make it writable, but configurable > instead was suggested by Claude Pache [2]. > > Nathan's original post [1] 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 [6]: > > This is a data property with a value of 1. This property > has the attributes { [[Writable]]: false, [[Enumerable]]: > false, [[Configurable]]: false }. > > > [1] > http://www.mail-archive.com/[email protected]/msg21786.html > [2] > http://www.mail-archive.com/[email protected]/msg21792.html > [3] > http://www.mail-archive.com/[email protected]/msg21793.html > [4] > http://www.mail-archive.com/[email protected]/msg21794.html > [5] > http://www.mail-archive.com/[email protected]/msg21795.html > [6] > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-15.3.2.2 > <http://people.mozilla.org/%7Ejorendorff/es6-draft.html#sec-15.3.2.2> > > Thanks, > > -- > Jeremy Martin > 661.312.3853 > http://devsmash.com > @jmar777 > > > > > -- > Jeremy Martin > 661.312.3853 > http://devsmash.com > @jmar777 > > > > > -- > Jeremy Martin > 661.312.3853 > http://devsmash.com > @jmar777 > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss
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)
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: > https://bugs.ecmascript.org/show_bug.cgi?id=1587 Thanks again! (I see that Allen has already fixed this :D) Rick -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130717/05b8d0df/attachment.html>
No problem - I've enjoyed getting a glimpse into how this process works!
No problem - I've enjoyed getting a glimpse into how this process works! On Wed, Jul 17, 2013 at 5:55 PM, Rick Waldron <waldron.rick at gmail.com>wrote: > > > > 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: >> https://bugs.ecmascript.org/show_bug.cgi?id=1587 > > > Thanks again! > > (I see that Allen has already fixed this :D) > > Rick > > -- Jeremy Martin 661.312.3853 http://devsmash.com @jmar777 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130718/0e8a8966/attachment.html>
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: