-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple export defaults (T7242) #4204
Comments
Good call, I don't think we have any error handling for duplicate exports at the moment. |
If this is a spec violation, someone please provide a spec citation. |
Cross-posting from the open PR: Thanks for the comment! I'll be up front - my experience reading the spec is limited at best at the moment, but I think this section references the error we're reporting in this PR. The relevant part seems to be the note at the bottom:
Does that look right to you? |
Thanks @kaicataldo! That does seem like the relevant reference. (Hmm...I'm not sure off the top of my head what they're referring to with "Additional error conditions [...]".) Actually that was kind of my bad 🤦 for forgetting that multiple |
I'm happy to continue working on this, and would be willing to try my hand at the relevant Babylon change, if need be - what are your thoughts on @hzoo's suggestion [[ https://github.com//pull/3518#issuecomment-225709319 | here ]]? |
It seems this landed in master now and for the proper fix in the parser there is already an issue. |
Bug information
Input code
Description
I'm not sure if this is intended or has just been overlooked, but the above code does not produce an error.
I was able to find a few references to support this, namely a reference on [[ https://developer.mozilla.org/en/docs/web/javascript/reference/statements/export#Description | MDN]] and a post by Dr. Axel Rauschmayer's on [[ http://www.2ality.com/2014/09/es6-modules-final.html#an_overview_of_the_es6_module_syntax | 2ality ]], but I couldn't track it down specifically in the ES spec.
In addition, this is reported as an error on the [[ http://www.typescriptlang.org/Playground#src=export%20default%20class%20A%20%7B%0A%7D%0A%0Aexport%20default%20class%20B%20%7B%0A%7D| Typescript Playground]].
The text was updated successfully, but these errors were encountered: