Axel Rauschmayer (2015-03-25T17:12:42.000Z)
> I'm all for using Reflect, but looking at the API as listed on MDN, the harmony-reflect github, or the spec, i don't see an obvious way of getting the parameters.


If I understand you correctly (and this is not about parsing the parameter definitions) then how about the following solution?

```js
function foo(…args) {
    let [a, b = 2] = args;
    return args;
}
```

Original code:

```js
function foo( a, b = 2 ) {
    return arguments;
}
```

-- 
Dr. Axel Rauschmayer
axel at rauschma.de
rauschma.de

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150325/009eaa9b/attachment.html>
d at domenic.me (2015-04-14T22:06:21.430Z)
> I'm all for using Reflect, but looking at the API as listed on MDN, the harmony-reflect github, or the spec, i don't see an obvious way of getting the parameters.


If I understand you correctly (and this is not about parsing the parameter definitions) then how about the following solution?

```js
function foo(...args) {
    let [a, b = 2] = args;
    return args;
}
```

Original code:

```js
function foo( a, b = 2 ) {
    return arguments;
}
```