On Fri, Mar 14, 2014 at 9:15 AM, Rick Waldron <waldron.r...@gmail.com>wrote:
> > > > On Fri, Mar 14, 2014 at 11:04 AM, Kevin Smith <zenpars...@gmail.com>wrote: > >> >>> >>> Because it doesn't allow for the Assignment Expression form >>> (specifically, function expressions) that developers expect to be able to >>> write: >>> >>> export default function() {} >>> >> >> The alternative here is: >> >> function MyThing() {} >> export { MyThing as default }; >> >> Which is more clear, more readable, >> > > I think it's fair to say that these are subjective claims. > Indeed, and subjectively I agree with Kevin. > > >> and barely less ergonomic. If you *really* want the AssignmentExpression >> form, you've got to put the equals in there. >> > > I don't understand this claim, any legal AssignmentExpression form is > allowed. > > >> I've said this before, but without the equals it looks too much like a >> declaration: >> >> export default class C {} >> var c = new C(); // No C defined, WTF? >> > > Why is this surprising? > It is surprising because it looks like it should work like export class C {} The keyword 'default' looks like a modifier like 'const'. > > If a developer knows how named function expression bindings work today, > this won't be a big surprise. > I know how named function expressions work and it's still surprising. jjb
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss