Justin Ridgewell 2af7a33c4e Fix class inheritance in IE10 (#7969)
* Revert "Move subclass inheritance to end (#7772)"

This reverts commit f8ab9466d331871a90f458af40b14e8d831e0c29.

* Only use getPrototypeOf if setPrototypeOf is implemented

* Update fixtures

* Helpers updates

* Update fixtures

* Fall back to getPrototypeOf

* Update fixtures
2018-05-23 16:21:21 -04:00

51 lines
1.1 KiB
JavaScript

var Point =
/*#__PURE__*/
function () {
"use strict";
function Point() {
babelHelpers.classCallCheck(this, Point);
}
babelHelpers.createClass(Point, [{
key: "getX",
value: function getX() {
expect(this.x).toBe(3); // C
}
}]);
return Point;
}();
var ColorPoint =
/*#__PURE__*/
function (_Point) {
"use strict";
babelHelpers.inherits(ColorPoint, _Point);
function ColorPoint() {
var _this;
babelHelpers.classCallCheck(this, ColorPoint);
_this = babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(ColorPoint).call(this));
_this.x = 2;
babelHelpers.set(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", 3, babelHelpers.assertThisInitialized(_this), true);
expect(_this.x).toBe(3); // A
expect(babelHelpers.get(babelHelpers.getPrototypeOf(ColorPoint.prototype), "x", babelHelpers.assertThisInitialized(_this))).toBeUndefined(); // B
return _this;
}
babelHelpers.createClass(ColorPoint, [{
key: "m",
value: function m() {
this.getX();
}
}]);
return ColorPoint;
}(Point);
var cp = new ColorPoint();
cp.m();