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

Update to es2017 sweet-spec #740

Merged
merged 1 commit into from
Aug 17, 2017
Merged

Conversation

disnet
Copy link
Member

@disnet disnet commented Aug 16, 2017

@disnet disnet requested a review from gabejohnson August 16, 2017 03:02
@@ -183,8 +183,22 @@ export class Enforester {
let moduleSpecifier = null;
Copy link
Member

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.

@@ -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 };
Copy link
Member

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 };
}

return new T.BindingIdentifier({ name: term.inner.get(0).value });
}
return term;
// if (term.inner.size === 1 && this.isIdentifier(term.inner.get(0))) {
Copy link
Member

Choose a reason for hiding this comment

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

Remove commented-out code

@@ -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 => ({
Copy link
Member

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

@disnet disnet force-pushed the refactor/update-spec-es2017 branch from 8b8279b to 60ffc8f Compare August 17, 2017 03:44
@disnet
Copy link
Member Author

disnet commented Aug 17, 2017

Addressed comments. Thanks!

@disnet disnet force-pushed the refactor/update-spec-es2017 branch from 60ffc8f to 78a8eaf Compare August 17, 2017 03:54
@gabejohnson gabejohnson merged commit 20ed1d9 into master Aug 17, 2017
@disnet disnet deleted the refactor/update-spec-es2017 branch August 17, 2017 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants