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

Add transform #5906

merged 10 commits into from Jul 7, 2017


None yet
5 participants

jridgewell commented Jun 30, 2017

Patch: Bug Fix? No
Major: Breaking Change? No
Minor: New Feature? Yes
Deprecations? No
Spec Compliancy? Yes?
Tests Added/Pass? Yes
Fixed Tickets Fixes #1088
License MIT
Doc PR
Dependency Changes

Transforms into a (correct in most cases) this.constructor expression.


xtuc approved these changes Jun 30, 2017


This comment has been minimized.


jridgewell commented Jul 1, 2017

I realized we could transform all Class uses of, because the constructors have to be called as constructors. Now the only real edge cases are using before super(), and ES5-style function class inheritance.


This comment has been minimized.


existentialism commented Jul 7, 2017

/cc: @getify @stevenvachon



@jridgewell jridgewell merged commit 628061c into babel:7.0 Jul 7, 2017

3 checks passed

ci/circleci Your tests passed on CircleCI!
codecov/project 85.68% (target 80%)
continuous-integration/travis-ci/pr The Travis CI build passed

@jridgewell jridgewell deleted the jridgewell:new-target branch Jul 7, 2017

GulajavaMinistudio added a commit to GulajavaMinistudio/babel that referenced this pull request Jul 7, 2017

Merge pull request #61 from babel/7.0
Update upstream Add transform (babel#5906)
class Bar {
constructor() {
var _newtarget2 = this.constructor;

This comment has been minimized.


bergus Jul 11, 2017

Not sure why this variable should have a 2 suffix?

This comment has been minimized.


jridgewell Jul 11, 2017


That's how babel generateUidIdentifier works, it's unique globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment