-
-
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
Improve babel-generator's code coverage #5338
Conversation
@Alxpy, thanks for your PR! By analyzing the history of the files in this pull request, we identified @loganfsmyth, @hzoo and @cpojer to be potential reviewers. |
Codecov Report
@@ Coverage Diff @@
## master #5338 +/- ##
==========================================
+ Coverage 89.44% 89.52% +0.07%
==========================================
Files 204 204
Lines 9949 9944 -5
Branches 2689 2688 -1
==========================================
+ Hits 8899 8902 +3
+ Misses 1050 1042 -8
Continue to review full report at Codecov.
|
@@ -45,12 +45,6 @@ export function ExportAllDeclaration(node: Object) { | |||
this.word("export"); | |||
this.space(); | |||
this.token("*"); | |||
if (node.exported) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah I was thinking of export * as ns from 'mod';
from https://babeljs.io/docs/plugins/transform-export-extensions/ but it's a different node - ExportNamespaceSpecifier ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking it is ExportNamedDeclaration -- babel/babylon#367
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can plug it into https://astexplorer.net: * as ns
is ExportNamespaceSpecifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, yes, I watched, sorry... we just talked about different parts of the AST =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work 👍
@@ -0,0 +1,7 @@ | |||
let a = do { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure - we can add ^ in this test as well
I worked on improvement
babel-generator
s code coverage: added a couple of tests, removed the code that does not meet spec (ExportAllDeclaration
has noexported
field, proof) and I proposed to remove the obsolete code (7e540cd).I see no reason to test this code, it is deleted in 7.0.