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

21 lines
597 B
JavaScript

var Test = /*#__PURE__*/function () {
"use strict";
function Test() {
babelHelpers.classCallCheck(this, Test);
return babelHelpers.superPropGet(Test, "constructor", this, 1);
}
return babelHelpers.createClass(Test, null, [{
key: "test",
value: function test() {
return babelHelpers.superPropGet(Test, "constructor", this);
}
}]);
}(); // Instances
expect(Object.getPrototypeOf(Test.prototype)).toBe(Object.prototype);
expect(new Test()).toBe(Object);
// Static
expect(Object.getPrototypeOf(Test)).toBe(Function.prototype);
expect(Test.test()).toBe(Function);