Re: missing non-rest_parameters should throw error

2011-10-27 Thread Allen Wirfs-Brock
On Oct 27, 2011, at 12:04 AM, Andrea Giammarchi wrote: > point 1 is utopia since ...varname breaks syntax in any case No, you missed the point. this need to be valid "Harmony code" in order to avoid a migration tax: function f() { return g.apply(undefined,arguments); } no ... or any othe

Re: missing non-rest_parameters should throw error

2011-10-27 Thread Andreas Rossberg
On 26 October 2011 20:27, Allen Wirfs-Brock wrote: > > 1) arguments is needed for backwards compatability (no migration tax) > 2) it is useful with destructing parameters: > function ({a,b,c}, [x,y]) { >   if (arguments.length < 2) ... >   ... >    var arg1obj = argruments[0]; >    ... All langua

Re: missing non-rest_parameters should throw error

2011-10-27 Thread Andrea Giammarchi
point 1 is utopia since ...varname breaks syntax in any case second point would be easier like this ? function (arg1obj={a,b,c}, p=[x,y]) { } On Wed, Oct 26, 2011 at 8:27 PM, Allen Wirfs-Brock wrote: > > > 1) arguments is needed for backwards compatability (no migration tax) > > 2) it is usefu

Re: missing non-rest_parameters should throw error

2011-10-26 Thread Allen Wirfs-Brock
1) arguments is needed for backwards compatability (no migration tax) 2) it is useful with destructing parameters: function ({a,b,c}, [x,y]) {   if (arguments.length < 2) ...   ...    var arg1obj = argruments[0];    ... Sent from Samsung tablet___

Re: missing non-rest_parameters should throw error

2011-10-26 Thread Andrea Giammarchi
I am not sure I am missing something but I think arguments could disappear without problems, being easily simulated like this: function f1(...arguments) { f2.apply(this, arguments); f2(...arguments); let [a,b,c,...rest] = arguments; // etc etc } Am I wrong ? br On Wed, Oct 26, 2

missing non-rest_parameters should throw error

2011-10-26 Thread Xavier MONTILLET
http://wiki.ecmascript.org/doku.php?id=harmony:rest_parameters Hi, Here is the behavior I would like: function f( a, b, ...rest ) { } f( 1, 1 );// ok f( 1, 1, 1 );// ok f( 1, undefined );// ok f( 1 );// Error: missing parameter Because since you can't reference a and b as properties of an objec