mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* 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]>
27 lines
688 B
JavaScript
27 lines
688 B
JavaScript
"use strict";
|
|
|
|
let Base = /*#__PURE__*/babelHelpers.createClass(function Base() {
|
|
babelHelpers.classCallCheck(this, Base);
|
|
});
|
|
let Obj = /*#__PURE__*/function (_Base) {
|
|
function Obj() {
|
|
babelHelpers.classCallCheck(this, Obj);
|
|
return babelHelpers.callSuper(this, Obj, arguments);
|
|
}
|
|
babelHelpers.inherits(Obj, _Base);
|
|
return babelHelpers.createClass(Obj, [{
|
|
key: "get",
|
|
value: function get() {
|
|
return babelHelpers.superPropGet(Obj, "test", this, 1);
|
|
}
|
|
}]);
|
|
}(Base);
|
|
Object.defineProperty(Obj.prototype, 'test', {
|
|
value: 2,
|
|
writable: true,
|
|
configurable: true
|
|
});
|
|
const obj = new Obj();
|
|
expect(obj.test).toBe(2);
|
|
expect(obj.get()).toBeUndefined();
|