Skip to content
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

Move javascript.statements.default.exports to exports.default; remove default.switch #5869

Merged
merged 3 commits into from
May 21, 2020

Conversation

queengooborg
Copy link
Contributor

@queengooborg queengooborg commented Mar 24, 2020

This PR fixes #4898. During the KR to achieve 100% real values for JavaScript, I had gotten a little bit confused in regards to the structure of the default keyword. The keyword doesn't have its own compatibility data, and does not have any function on its own; only when used within the switch and export keywords. Furthermore, depending on which keyword its used for, it has a different meaning.

This PR refactors the default keyword to be two subfeatures under switch and export instead of a single feature with two subfeatures.

Edit: as per request, default.switch was later removed, leaving only default.export.

@ghost ghost added the data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript label Mar 24, 2020
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for looking into this!

I agree this is confusing and I think the page https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/default makes no sense and should be redirected to the switch statement.

Also, javascript.statements.switch.default should be removed entirely. The default switch keyword is naturally part of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/switch and doesn't need special compat data.

For default exports, it makes sense to have the compat data under javascript.statements.export.default as you've done here. So, that's good. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export already talks about default exports, we don't need https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/default for that.

So, tl;dr; please don't add javascript.statements.switch.default and then this should be good to go.

@queengooborg queengooborg changed the title Move default keyword under switch/export keywords Move javascript.statements.default.exports to exports.default; remove default.switch May 21, 2020
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@Elchi3 Elchi3 merged commit 862ec42 into mdn:master May 21, 2020
@queengooborg queengooborg deleted the javascript/default branch May 21, 2020 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:js Compat data for JS/ECMAScript features. https://developer.mozilla.org/docs/Web/JavaScript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

javascript.statements.default: move data?
3 participants