Debian Codegraph @

packages/babel-plugin-transform-classes/test/fixtures/get-set/call-semantics-setter-defined-on-parent/output.js

raw
1 "use strict";
2
3 let Base = /*#__PURE__*/function () {
4 function Base() {
5 babelHelpers.classCallCheck(this, Base);
6 }
7 babelHelpers.createClass(Base, [{
8 key: "test",
9 set: function (v) {
10 throw new Error("gobbledygook");
11 }
12 }]);
13 return Base;
14 }();
15 let Obj = /*#__PURE__*/function (_Base) {
16 babelHelpers.inherits(Obj, _Base);
17 var _super = babelHelpers.createSuper(Obj);
18 function Obj() {
19 babelHelpers.classCallCheck(this, Obj);
20 return _super.apply(this, arguments);
21 }
22 babelHelpers.createClass(Obj, [{
23 key: "call",
24 value: function call() {
25 return babelHelpers.get(babelHelpers.getPrototypeOf(Obj.prototype), "test", this).call(this);
26 }
27 }, {
28 key: "test",
29 value: function test() {
30 throw new Error("gobbledygook");
31 }
32 }]);
33 return Obj;
34 }(Base);
35 const obj = new Obj();
36 expect(() => {
37 obj.call();
38
39 // Assert that this throws, but that it's not
40 // a gobbledygook error that is thrown
41 }).toThrow(TypeError);