Fix class inheritance in IE10 (#7969)

* Revert "Move subclass inheritance to end (#7772)"

This reverts commit f8ab9466d3.

* Only use getPrototypeOf if setPrototypeOf is implemented

* Update fixtures

* Helpers updates

* Update fixtures

* Fall back to getPrototypeOf

* Update fixtures
This commit is contained in:
Justin Ridgewell
2018-05-23 16:21:21 -04:00
committed by Henry Zhu
parent ffe04d9195
commit 2af7a33c4e
151 changed files with 461 additions and 487 deletions

View File

@@ -15,6 +15,8 @@ var _binarySerializer = babelHelpers.interopRequireDefault(require("./helpers/bi
var Connection =
/*#__PURE__*/
function (_EventEmitter) {
babelHelpers.inherits(Connection, _EventEmitter);
function Connection(endpoint, joinKey, joinData, roomId) {
var _this;
@@ -37,7 +39,6 @@ function (_EventEmitter) {
this.sock.close();
}
}]);
babelHelpers.inherits(Connection, _EventEmitter);
return Connection;
}(_events.EventEmitter);

View File

@@ -10,6 +10,8 @@ var _BaseFoo2 = babelHelpers.interopRequireDefault(require("./BaseFoo"));
var SubFoo =
/*#__PURE__*/
function (_BaseFoo) {
babelHelpers.inherits(SubFoo, _BaseFoo);
function SubFoo() {
babelHelpers.classCallCheck(this, SubFoo);
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(SubFoo).apply(this, arguments));
@@ -22,7 +24,6 @@ function (_BaseFoo) {
console.log('SubFoo.talk');
}
}]);
babelHelpers.inherits(SubFoo, _BaseFoo);
return SubFoo;
}(_BaseFoo2.default);

View File

@@ -10,6 +10,8 @@ var _react = babelHelpers.interopRequireDefault(require("react"));
var RandomComponent =
/*#__PURE__*/
function (_Component) {
babelHelpers.inherits(RandomComponent, _Component);
function RandomComponent() {
babelHelpers.classCallCheck(this, RandomComponent);
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(RandomComponent).call(this));
@@ -23,7 +25,6 @@ function (_Component) {
}, _react.default.createElement("h2", null, "Hi there!"));
}
}]);
babelHelpers.inherits(RandomComponent, _Component);
return RandomComponent;
}(_react.Component);

View File

@@ -12,6 +12,8 @@ var b = function b() {
var a1 =
/*#__PURE__*/
function (_b) {
babelHelpers.inherits(a1, _b);
function a1() {
var _this;
@@ -25,13 +27,14 @@ function (_b) {
return _this;
}
babelHelpers.inherits(a1, _b);
return a1;
}(b);
var a2 =
/*#__PURE__*/
function (_b2) {
babelHelpers.inherits(a2, _b2);
function a2() {
var _this2;
@@ -45,7 +48,6 @@ function (_b2) {
return _this2;
}
babelHelpers.inherits(a2, _b2);
return a2;
}(b);

View File

@@ -21,6 +21,8 @@ var ColorPoint =
function (_Point) {
"use strict";
babelHelpers.inherits(ColorPoint, _Point);
function ColorPoint() {
var _this;
@@ -41,7 +43,6 @@ function (_Point) {
this.getX();
}
}]);
babelHelpers.inherits(ColorPoint, _Point);
return ColorPoint;
}(Point);

View File

@@ -3,6 +3,8 @@ var A =
function (_B) {
"use strict";
babelHelpers.inherits(A, _B);
function A() {
var _this;
@@ -20,6 +22,5 @@ function (_B) {
return _this;
}
babelHelpers.inherits(A, _B);
return A;
}(B);

View File

@@ -4,12 +4,13 @@ var x = {
function (_Foo) {
"use strict";
babelHelpers.inherits(_class, _Foo);
function _class() {
babelHelpers.classCallCheck(this, _class);
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(_class).apply(this, arguments));
}
babelHelpers.inherits(_class, _Foo);
return _class;
}(Foo)
};

View File

@@ -9,6 +9,8 @@ var B =
function (_A) {
"use strict";
babelHelpers.inherits(B, _A);
function B() {
var _this;
@@ -16,6 +18,5 @@ function (_A) {
return babelHelpers.possibleConstructorReturn(_this, _this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(B).call(this)));
}
babelHelpers.inherits(B, _A);
return B;
}(A);

View File

@@ -1,14 +1,14 @@
function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } _setPrototypeOf(subClass.prototype, superClass && superClass.prototype); 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 _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 _getPrototypeOf(o) { _getPrototypeOf = Object.getPrototypeOf || function _getPrototypeOf(o) { return o.__proto__; }; return _getPrototypeOf(o); }
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
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 _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } }
@@ -25,6 +25,8 @@ var A =
function (_B) {
"use strict";
_inherits(A, _B);
function A(track) {
var _this;
@@ -34,7 +36,5 @@ function (_B) {
return _possibleConstructorReturn(_this);
}
_inherits(A, _B);
return A;
}(B);