Files
80fc33a72a Improve super.x output (#16374)
* clean

* improve

* tests

* fix lint

* old helpers

* add fail test

* fix

* Update packages/babel-helpers/src/helpers/superPropGet.ts

Co-authored-by: Nicolò Ribaudo <[email protected]>

* review

* fix lint

* minVersion

---------

Co-authored-by: Nicolò Ribaudo <[email protected]>
2024-07-23 11:37:07 +08:00

30 lines
780 B
JavaScript

"use strict";
var Hello = /*#__PURE__*/function () {
function Hello() {
babelHelpers.classCallCheck(this, Hello);
}
return babelHelpers.createClass(Hello, [{
key: "toString",
value: function toString() {
return 'hello';
}
}]);
}();
var Outer = /*#__PURE__*/function (_Hello) {
function Outer() {
var _this;
babelHelpers.classCallCheck(this, Outer);
_this = babelHelpers.callSuper(this, Outer);
var Inner = {
[babelHelpers.superPropGet((_this, Outer), "toString", _this, 3)([])]() {
return 'hello';
}
};
return babelHelpers.possibleConstructorReturn(_this, Inner);
}
babelHelpers.inherits(Outer, _Hello);
return babelHelpers.createClass(Outer);
}(Hello);
expect(new Outer().hello()).toBe('hello');