Message from JavaScript discussions

April 2019

— What do you want to do if they fail?


Depends on the elem. Some are necessary some are not. I want to be able to provide a fallback or if its a necessary elem at best delete the instance. Is it possible to delete a class instance inside of the class?

— Throw during construction

— Prevents creating the class

— Oh nice. Perfect.

— What if the fallback fails?

— Also delete the instance / prevent creating one

— Edited

— Third argument is fallback selector

— Thanks. When assertExists is a class method and I call this method inside of the constructor and it throws. Does this also prevent creating the instance?

Message permanent page

— Yes

— It should be a static method tho I guess