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

[class-properties] Remove unnecessary return and temp variable #8123

Merged
merged 2 commits into from Jun 8, 2018

Conversation

@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Jun 6, 2018

super() is already implicitly returned, so we don't need the return statement.

Input:

class A extends B {
  foo = 2;
}

Before:

class A extends B {
  constructor(...args) {
    var _temp;

    return _temp = super(...args), _defineProperty(this, "foo", 2), _temp;
  }

}

After:

class A extends B {
  constructor(...args) {
    super(...args);
    _defineProperty(this, "foo", 2);
  }

}
@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Jun 6, 2018

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8308/

1 similar comment
@babel-bot

This comment has been minimized.

Copy link
Collaborator

babel-bot commented Jun 6, 2018

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/8308/

@hzoo
hzoo approved these changes Jun 8, 2018
@nicolo-ribaudo nicolo-ribaudo merged commit 9f4e2f8 into babel:master Jun 8, 2018
4 checks passed
4 checks passed
babel/repl REPL preview is available
Details
ci/circleci Your tests passed on CircleCI!
Details
codecov/project 80.57% (target 80%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@nicolo-ribaudo nicolo-ribaudo deleted the nicolo-ribaudo:misc branch Jun 8, 2018
@lock lock bot added the outdated label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.