inline arrow function uses additional parameters

20 views
Skip to first unread message

João Fernandes

unread,
Feb 4, 2015, 11:04:41 AM2/4/15
to traceur-comp...@googlegroups.com
Hi, I'm using arrow functions to define promises then functions like SomePromise.then(result => .....) which results in 

SomePromise.then(
       (function(result) {}...)
)

When using JSLint, I get the following warning "Wrapping non-IIFE function literals in parens is unnecessary."

So my question is, are we supposed to use arrow functions in this case or it's something that traceur doesn't support yet?

Thanks

Erik Arvidsson

unread,
Feb 4, 2015, 12:52:15 PM2/4/15
to traceur-comp...@googlegroups.com
I would be very surprised if the generated code passes any kind of linter.

It is of course possible to remove the parens in some cases but there
are cases where they are needed so we add them at all times to keep
the code cleaner. We expect that minimizers like UglifyJS or Closure
Compiler will remove some of our useless parens and unused temp
variables.
> --
> You received this message because you are subscribed to the Google Groups
> "traceur-compiler-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to traceur-compiler-d...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
erik

João Fernandes

unread,
Feb 4, 2015, 2:52:02 PM2/4/15
to traceur-comp...@googlegroups.com
I'll run JSLint against the optimized code and check if the warning goes away.

Thanks Erik.


--
You received this message because you are subscribed to a topic in the Google Groups "traceur-compiler-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/traceur-compiler-discuss/FXie9qzdhRE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to traceur-compiler-d...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

João Fernandes
Reply all
Reply to author
Forward
0 new messages