Debian Codegraph @

packages/babel-plugin-proposal-private-methods/test/fixtures/private-method-privateFieldsAsProperties/context/input.js

raw
1 class Foo {
2 constructor(status) {
3 this.status = status;
4 }
5
6 #getStatus() {
7 return this.status;
8 }
9
10 getCurrentStatus() {
11 return this.#getStatus();
12 }
13
14 setCurrentStatus(newStatus) {
15 this.status = newStatus;
16 }
17
18 getFakeStatus(fakeStatus) {
19 const fakeGetStatus = this.#getStatus;
20 return function() {
21 return fakeGetStatus.call({ status: fakeStatus });
22 };
23 }
24
25 getFakeStatusFunc() {
26 return {
27 status: 'fake-status',
28 getFakeStatus: this.#getStatus,
29 };
30 }
31 }