/
output.js
49 lines (38 loc) 路 985 Bytes
/
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
45
46
47
48
49
"use strict";
let value = 1;
let Base = /*#__PURE__*/function () {
function Base() {}
babelHelpers.createClass(Base, [{
key: "test",
set: function (v) {
value = v;
}
}]);
return Base;
}();
let Obj = /*#__PURE__*/function (_Base) {
babelHelpers.inheritsLoose(Obj, _Base);
function Obj() {
return _Base.apply(this, arguments) || this;
}
var _proto = Obj.prototype;
_proto.set = function set() {
return this.test = 3;
};
return Obj;
}(Base);
Object.defineProperty(Obj.prototype, 'test', {
value: 2,
writable: true,
configurable: true
});
const obj = new Obj();
expect(obj.set()).toBe(3); // This is incorrect according to the spec,
// but close enough for loose.
// expect(value).toBe(3);
expect(value).toBe(1);
expect(Base.prototype.test).toBeUndefined();
expect(Obj.prototype.test).toBe(2); // This is incorrect according to the spec,
// but close enough for loose.
// expect(obj.test).toBe(2);
expect(obj.test).toBe(3);