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

Unnecessary variable injected by class-properties plugin #6916

nicolo-ribaudo opened this Issue Nov 27, 2017 · 0 comments


None yet
1 participant

nicolo-ribaudo commented Nov 27, 2017

Choose one: is this a bug report or feature request?

Input Code

var foo = "bar";

let Foo = class Foo {
  bar = foo;

  constructor() {
    var foo = "foo";

Babel/Babylon Configuration (.babelrc, package.json, cli command)

  "presets": ["@babel/stage-3"]

Current Behavior

var _class, _temp, _initialiseProps;

var foo = "bar";
let Foo = (_temp = _class = class Foo {
  constructor() {;

    var foo = "foo";

}, _initialiseProps = function () {
  Object.defineProperty(this, "bar", {
    configurable: true,
    enumerable: true,
    writable: true,
    value: foo
}, _temp);

The _class variable shouldn't be added.

Your Environment

(Found in repl, not tested locally)

software version(s)
Babel 7.0.0-beta.32
Operating System
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment