-
Notifications
You must be signed in to change notification settings - Fork 211
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
Update to es2017 sweet-spec #740
Conversation
src/enforester.js
Outdated
@@ -183,8 +183,22 @@ export class Enforester { | |||
let moduleSpecifier = null; |
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.
It'd probably be good to get rid of these let moduleSpecifier
bindings . They're just noise at this point.
src/enforester.js
Outdated
@@ -243,12 +257,12 @@ export class Enforester { | |||
if (this.isIdentifier(this.peek(), 'as')) { | |||
this.advance(); | |||
let exportedName = this.enforestIdentifier(); | |||
return new T.ExportSpecifier({ name, exportedName }); | |||
return { name, exportedName }; |
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.
This could probably be consolidated to
enforestExportSpecifier() {
const name = this.enforestIdentifier();
let exportedName = null;
if (this.isIdentifier(this.peek(), 'as')) {
this.advance();
exportedName = this.enforestIdentifier();
}
return { name, exportedName };
}
src/enforester.js
Outdated
return new T.BindingIdentifier({ name: term.inner.get(0).value }); | ||
} | ||
return term; | ||
// if (term.inner.size === 1 && this.isIdentifier(term.inner.get(0))) { |
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.
Remove commented-out code
src/sweet-module.js
Outdated
@@ -54,6 +54,11 @@ function extractSpecifiers(term: any): List<ExportSpecifier> { | |||
return List(); | |||
} else if (S.isExportFrom(term)) { | |||
return term.namedExports; | |||
} else if (S.isExportLocals(term)) { | |||
return term.namedExports.map(s => ({ |
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.
Destructure s
to make it consistent w/ line 151
8b8279b
to
60ffc8f
Compare
Addressed comments. Thanks! |
60ffc8f
to
78a8eaf
Compare
Goes with sweet-js/sweet-spec#3