Debian Codegraph @

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

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