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
abstract + throw + mandatory + force implementation
Suggestion:
In Typescript development environment, we get safe using abstraction stuff, but once we emit our abstract class as an upstream lib to vanilla javascript users, we can't make sure they will make implementation for all abstract methods.
This suggestion is adding mandatory implementation by generating throwing error statements in the abstract class constructor and the abstract methods' function body. At least, it will help in runtime and avoids the problem that caused by inexists/non-implementation of abstract methods.
Search Terms:
abstract + throw + mandatory + force implementation
Suggestion:
In Typescript development environment, we get safe using abstraction stuff, but once we emit our abstract class as an upstream lib to vanilla javascript users, we can't make sure they will make implementation for all abstract methods.
This suggestion is adding mandatory implementation by generating throwing error statements in the abstract class constructor and the abstract methods' function body. At least, it will help in runtime and avoids the problem that caused by inexists/non-implementation of abstract methods.
Expected behavior:
abstract class and abstract method:
generate:
it forbids vanilla javascript calls like:
The text was updated successfully, but these errors were encountered: