/
output.js
44 lines (43 loc) 路 1.04 KB
/
output.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
"use strict";
let Base = /*#__PURE__*/function () {
function Base() {
babelHelpers.classCallCheck(this, Base);
}
babelHelpers.createClass(Base, [{
key: "test",
get: function () {
return 1;
}
}]);
return Base;
}();
;
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: "set",
value: function set() {
return babelHelpers.set(babelHelpers.getPrototypeOf(Obj.prototype), "test", 3, this, true);
}
}]);
return Obj;
}(Base);
Object.defineProperty(Obj.prototype, 'test', {
value: 2,
writable: true,
configurable: true
});
const obj = new Obj();
expect(() => {
// this requires helpers to be in file (not external), so they
// are in "strict" mode code.
obj.set();
}).toThrow(TypeError);
expect(Base.prototype.test).toBe(1);
expect(Obj.prototype.test).toBe(2);
expect(obj.test).toBe(2);