Use of ES6 Default Function Parameter Value Spec in Lightning Components

It turns out Lightning Components are using a version of closure compiler that is incompatible with this syntax currently. So as of Summer 16, certain syntax that is ES6 compliant will not work with Lightning Components.

I found this out through raising an issue with the aura open source framework repo in github.


I have just bumped in this issue and I would like to share my findings.

The following syntax is still not supported (you'll get a JsonStreamParseException):

myFunction = function (param1 = "this", param2 = "that")

However, if you write it this way (without spaces around the equal signs), the default parameter values work fine:

myFunction = function (param1="this", param2="that")

I hope this will help someone.