Default function arguments not using current scope

Cyril Auburtin cyril.auburtin at gmail.com
Thu Apr 5 08:40:43 UTC 2018


It's rather a name clashing I guess, the error message was just confusing

since this works fine:
```js
var Z=1; var fn = (z = Z) => z; fn() // 1
```

2018-04-05 10:29 GMT+02:00 Cyril Auburtin <cyril.auburtin at gmail.com>:

> I don't understand:
>
> ```js
>
> var z=1; var fn = (z = z) => z; fn() // throws ReferenceError: z is not
> defined
> ```
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20180405/b4874321/attachment.html>


More information about the es-discuss mailing list