Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com> Co-authored-by: Babel Bot <babel-bot@users.noreply.github.com>
40 lines
847 B
JavaScript
40 lines
847 B
JavaScript
"use strict";
|
|
|
|
let Base = function Base() {
|
|
babelHelpers.classCallCheck(this, Base);
|
|
};
|
|
|
|
let value = 2;
|
|
|
|
let Obj = /*#__PURE__*/function (_Base) {
|
|
babelHelpers.inherits(Obj, _Base);
|
|
|
|
var _super = babelHelpers.createSuper(Obj);
|
|
|
|
function Obj() {
|
|
babelHelpers.classCallCheck(this, Obj);
|
|
return _super.apply(this, arguments);
|
|
}
|
|
|
|
babelHelpers.createClass(Obj, [{
|
|
key: "test",
|
|
set: function (v) {
|
|
expect(this).toBe(obj);
|
|
value = v;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set() {
|
|
return babelHelpers.set(babelHelpers.getPrototypeOf(Obj.prototype), "test", 3, this, true);
|
|
}
|
|
}]);
|
|
return Obj;
|
|
}(Base);
|
|
|
|
const obj = new Obj();
|
|
expect(obj.set()).toBe(3);
|
|
expect(Base.prototype.test).toBeUndefined();
|
|
expect(Obj.prototype.test).toBeUndefined();
|
|
expect(value).toBe(2);
|
|
expect(obj.test).toBe(3);
|