A couple of months ago, we discussed some issues with the default export
syntax, and Dave suggested making some minor tweaks so that these forms:

    export default function ...
    export default class ...

were declarations instead of expressions.

Has there been any movement on this issue recently?

I think this solution is acceptable, but I still maintain that it would be
less confusing for the user if we required an equal sign:

    export default = foo;

Consider the following case:

    export default { a: a1, b: b1 };

It would be easy for a beginner to misinterpret this as a shorthand for
multiple exports, when in fact this statement is exporting a single thing
which happens to be an object.

If the syntax were instead:

    export default = { a: a1, b: b2 };

such confusion is less likely.

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

Reply via email to