You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The generated constructor for the derived B class with a private field includes a field initializer before the super call which results in the following error in browser console if you copy paste the generated code:
VM17:64 Uncaught ReferenceError: Must call super constructor in derived class
before accessing 'this' or returning from derived constructor
at new B (<anonymous>:64:7)
at <anonymous>:71:3
at <anonymous>:72:3
Note that this only occurs if the property has no assigned value. If private m1: any = null is used, the initializer is correctly generated after the super() call.
Another thing to consider after looking at #3913 is, if this behavior should apply only for properties with decorators or even when only the class has a decorator as in my case. Otherwise this will be a breaking change for those using useDefineForClassFields: false. Does TypeScript behave this way, e.g. also for class decorators?
I think this is an issue introduced in 0.24 as 0.23.1 does not have this problem. Probably related to #3913
The generated constructor for the derived B class with a private field includes a field initializer before the super call which results in the following error in browser console if you copy paste the generated code:
The text was updated successfully, but these errors were encountered: