MDN article on Node interface states that
interfaces [that inherit from Node interface] may return null in particular cases where the methods and properties are not relevant. They may throw an exception - for example when adding children to a node type for which no children can exist.
To me it seems like a strengthening of preconditions in a subtype - a violation of LSP.
Do these implementations actually violate LSP, or is my understanding incorrect?
Aucun commentaire:
Enregistrer un commentaire