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]>
34 lines
862 B
JavaScript
34 lines
862 B
JavaScript
"use strict";
|
|
|
|
let Base = /*#__PURE__*/babelHelpers.createClass(function Base() {
|
|
babelHelpers.classCallCheck(this, Base);
|
|
});
|
|
Object.defineProperty(Base.prototype, 'test', {
|
|
value: 1,
|
|
writable: true,
|
|
configurable: true
|
|
});
|
|
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: "set",
|
|
value: function set() {
|
|
return babelHelpers.superPropSet(Obj, "test", 3, this, 1, 1);
|
|
}
|
|
}]);
|
|
}(Base);
|
|
Object.defineProperty(Obj.prototype, 'test', {
|
|
value: 2,
|
|
writable: true,
|
|
configurable: true
|
|
});
|
|
const obj = new Obj();
|
|
expect(obj.set()).toBe(3);
|
|
expect(Base.prototype.test).toBe(1);
|
|
expect(Obj.prototype.test).toBe(2);
|
|
expect(obj.test).toBe(3);
|