function f(a, b) {
   return [a, b];
 }

Currently:

 f(1, 2); // [1, 2]

Whereas...

 // single parameter, implicit arguments pseudo-array:
 f(1, 2);

|a| would be magically be treated like a ...rest param that wasn't really
an array, but instead a implicit arguments pseudo-array?

 // [[1, 2], undefined]

No, just another way to describe the current situation, where
   function f() {return [...arguments]}    // pseudo code
   f(1,2) // [1,2]

or, if we make the arguments explicit

   function f(...arguments) {return [...arguments]}    // pseudo code
   f(1,2) // [1,2]

and explicit formal parameters would be destructured from arguments,
so

function f(a,b) {return [a,b]} f(1,2) // [1,2]

The solutions shown above using [] also create ambiguity with:

- MemberExpression[ Expression ]
- CallExpression[ Expression ]

Given:

 function foo(value) {
   return value;
 }
 foo.prop = "Some data";

Currently:

 foo("prop"); // "prop"

 foo["prop"]; // "Some data"

ah, yes, I knew there had to be a serious flaw somewhere... sigh

Claus

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to