Justin Ridgewell 725e6a01c0 Don't fold class property calls (#7814)
This undoes the property call folding from #6656.

It complicates the private property transforms, since they boil down to `map.set(this, vlaue)` and we definitely don't want the next call define a property on the map.

/cc @Andarist
2018-04-26 15:06:18 -05:00

73 lines
1.3 KiB
JavaScript

var _this = this;
(function () {
class Foo {
constructor() {
var _this2 = this;
babelHelpers.defineProperty(this, "fn", function () {
return console.log(_this2);
});
}
}
babelHelpers.defineProperty(Foo, "fn", function () {
return console.log(_this);
});
});
(function () {
var _class, _temp;
return _temp = _class = class Bar {
constructor() {
var _this3 = this;
babelHelpers.defineProperty(this, "fn", function () {
return console.log(_this3);
});
}
}, babelHelpers.defineProperty(_class, "fn", function () {
return console.log(_this);
}), _temp;
});
(function () {
class Baz {
constructor(_force) {
var _this4 = this;
babelHelpers.defineProperty(this, "fn", function () {
return console.log(_this4);
});
babelHelpers.defineProperty(this, "force", force);
}
}
babelHelpers.defineProperty(Baz, "fn", function () {
return console.log(_this);
});
});
var qux = function () {
var _this6 = this;
class Qux {
constructor() {
var _this5 = this;
babelHelpers.defineProperty(this, "fn", function () {
return console.log(_this5);
});
}
}
babelHelpers.defineProperty(Qux, "fn", function () {
return console.log(_this6);
});
}.bind(this);