Debian Codegraph @

packages/babel-plugin-transform-classes/test/fixtures/regression/5769/output.js

raw
1 var Point = /*#__PURE__*/function () {
2 "use strict";
3
4 function Point() {
5 babelHelpers.classCallCheck(this, Point);
6 }
7 babelHelpers.createClass(Point, [{
8 key: "getX",
9 value: function getX() {
10 expect(this.x).toBe(3); // C
11 }
12 }]);
13 return Point;
14 }();
15 var ColorPoint = /*#__PURE__*/function (_Point) {
16 "use strict";
17
18 babelHelpers.inherits(ColorPoint, _Point);
19 var _super = babelHelpers.createSuper(ColorPoint);
20 function ColorPoint() {
21 var _thisSuper, _thisSuper2, _this;
22 babelHelpers.classCallCheck(this, ColorPoint);
23 _this = _super.call(this);
24 _this.x = 2;
25 babelHelpers.set((_thisSuper = babelHelpers.assertThisInitialized(_this), babelHelpers.getPrototypeOf(ColorPoint.prototype)), "x", 3, _thisSuper, true);
26 expect(_this.x).toBe(3); // A
27 expect(babelHelpers.get((_thisSuper2 = babelHelpers.assertThisInitialized(_this), babelHelpers.getPrototypeOf(ColorPoint.prototype)), "x", _thisSuper2)).toBeUndefined(); // B
28 return _this;
29 }
30 babelHelpers.createClass(ColorPoint, [{
31 key: "m",
32 value: function m() {
33 this.getX();
34 }
35 }]);
36 return ColorPoint;
37 }(Point);
38 var cp = new ColorPoint();
39 cp.m();