This is full-on bikeshedding, but I’d prefer a constant for this purpose (less 
grawlixy):

```js
import { NOOP } from 'someModule';
function tryCatchFinally(tryF, catchF = NOOP, finallyF = NOOP) {
  // ...
}
```
function.prototype could be used, too. But I don’t like that at all.


On Jul 28, 2013, at 6:49 , Domenic Denicola <[email protected]> wrote:

> I agree a missing body is usually weird;   the only case that really makes 
> sense is `=>`, which is especially useful in default parameter lists:
> 
> ```js
> function tryCatchFinally(tryF, catchF = =>, finallyF = =>) {
>   // ...
> }
> ```
> From: Axel Rauschmayer
> Sent: ‎7/‎28/‎2013 0:40
> To: Brandon Benvie
> Cc: [email protected]
> Subject: Re: More concise arrow functions
> 
> +1
> 
> My perspective: I don’t see a use case for a missing body, but a missing 
> parameter list would be very useful – to delay the execution of a block of 
> code. It also makes much sense visually:
> 
> 2.  (x, y) => { ... }
> 1.  x => { ... }
> 0.  => { ... }
> 
> On Jul 26, 2013, at 22:11 , Brandon Benvie <[email protected]> wrote:
> 
>> On 7/26/2013 11:53 AM, Michael Haufe wrote:
>>> A useless parameter is an option:
>>> 
>>> _=> 'foo'
>>> 
>> 
>> This seems to be an argument in favor of making the params completely 
>> optional. The fact that throwing in a useless param is more concise than 
>> having zero params (due to paranthesis requirement).
>> 
>> I think the semicolon hazard is enough to make omitting the body 
>> questionable, but omitting the params is an easy win with no downside.
>> _______________________________________________
>> es-discuss mailing list
>> [email protected]
>> https://mail.mozilla.org/listinfo/es-discuss
>> 
> 
> -- 
> Dr. Axel Rauschmayer
> [email protected]
> 
> home: rauschma.de
> twitter: twitter.com/rauschma
> blog: 2ality.com
> 

-- 
Dr. Axel Rauschmayer
[email protected]

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

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

Reply via email to