(flag: Flags, func: () => void)
| 817 | } |
| 818 | |
| 819 | private callFunctionWithSuper(flag: Flags, func: () => void): void { |
| 820 | this.setFlag(flag, false); |
| 821 | func(); |
| 822 | if (!this.isFlagSet(flag)) { |
| 823 | throw new Error(`super.${flag} not called in ${this}`); |
| 824 | } |
| 825 | } |
| 826 | |
| 827 | public callLoaded(): void { |
| 828 | this.callFunctionWithSuper(Flags.superOnLoadedCalled, () => this.onLoaded()); |