Fix duplicated assertThisInitialized calls in constructors (#9458)
This commit is contained in:
committed by
Nicolò Ribaudo
parent
d1514f57bd
commit
045d019149
@@ -12,13 +12,13 @@ function (_Bar) {
|
||||
|
||||
if (condition) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), _bar, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
} else {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), _bar, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -22,7 +22,7 @@ function (_Foo) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Bar);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Bar).call(this, ...args));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _prop2, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _prop2, {
|
||||
writable: true,
|
||||
value: "bar"
|
||||
});
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Parent) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Child);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _scopedFunctionWithThis, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _scopedFunctionWithThis, {
|
||||
writable: true,
|
||||
value: function value() {
|
||||
_this.name = {};
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _bar, {
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
}), _temp));
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), _bar, {
|
||||
Object.defineProperty(babelHelpers.assertThisInitialized(_this), _bar, {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -13,14 +13,14 @@ function (_Bar) {
|
||||
if (condition) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), {
|
||||
_bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
} else {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), {
|
||||
_bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ function (_Foo) {
|
||||
babelHelpers.classCallCheck(this, Bar);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Bar).call(this, ...args));
|
||||
|
||||
_prop2.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_prop2.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "bar"
|
||||
});
|
||||
|
||||
@@ -11,7 +11,7 @@ function (_Parent) {
|
||||
babelHelpers.classCallCheck(this, Child);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this));
|
||||
|
||||
_scopedFunctionWithThis.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_scopedFunctionWithThis.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: () => {
|
||||
_this.name = {};
|
||||
|
||||
@@ -29,7 +29,7 @@ function (_A) {
|
||||
babelHelpers.classCallCheck(this, B);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args));
|
||||
|
||||
_foo.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_foo.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this))
|
||||
});
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), _bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), _bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
}), _temp));
|
||||
|
||||
@@ -11,7 +11,7 @@ function (_Bar) {
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
|
||||
_bar.set(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), {
|
||||
_bar.set(babelHelpers.assertThisInitialized(_this), {
|
||||
writable: true,
|
||||
value: "foo"
|
||||
});
|
||||
|
||||
@@ -12,10 +12,10 @@ function (_Bar) {
|
||||
|
||||
if (condition) {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
} else {
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this))), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
}
|
||||
|
||||
return babelHelpers.possibleConstructorReturn(_this);
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this, ...args));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Parent) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Child);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Child).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "scopedFunctionWithThis", function () {
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "scopedFunctionWithThis", function () {
|
||||
_this.name = {};
|
||||
});
|
||||
return _this;
|
||||
|
||||
@@ -28,7 +28,7 @@ function (_A) {
|
||||
|
||||
babelHelpers.classCallCheck(this, B);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this, ...args));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "foo", babelHelpers.get(babelHelpers.getPrototypeOf(B.prototype), "foo", babelHelpers.assertThisInitialized(_this)).call(babelHelpers.assertThisInitialized(_this)));
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ function (_Bar) {
|
||||
var _temp, _this;
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo"), _temp));
|
||||
foo((_temp = _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this)), babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo"), _temp));
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ function (_Bar) {
|
||||
|
||||
babelHelpers.classCallCheck(this, Foo);
|
||||
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(Foo).call(this));
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(babelHelpers.assertThisInitialized(_this)), "bar", "foo");
|
||||
babelHelpers.defineProperty(babelHelpers.assertThisInitialized(_this), "bar", "foo");
|
||||
return _this;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterat
|
||||
|
||||
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
||||
|
||||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
||||
|
||||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
||||
|
||||
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
||||
|
||||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
||||
@@ -43,7 +43,7 @@ var Test = function Test() {
|
||||
|
||||
_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(Other)).call.apply(_getPrototypeOf2, [this].concat(args)));
|
||||
|
||||
_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "a", function () {
|
||||
_defineProperty(_assertThisInitialized(_this), "a", function () {
|
||||
return _get(_getPrototypeOf(Other.prototype), "test", _assertThisInitialized(_this));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user