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
This pattern is not recommended because (in the general case) it can succeed silently when it should fail.
The more typical pattern for functions in abstract types is to either (a) not define them so that they fail, or (b) implement a function that fails. My preference is for (b), since it also provides the opportunity to document. So recommended to replace the above with:
/**
* @returns {BodyConfiguration[]}
* @public
* @abstract
*/
getBodies: function() {
throw new Error( 'must be implemented by subtype' );
}
The text was updated successfully, but these errors were encountered:
Related to code review #173.
ModeConfig is intended to be an abstract base type, so the first thing would be to describe it as such in the JSdoc at the top of the file.
Then there's this function that must be implemented by subtypes:
This pattern is not recommended because (in the general case) it can succeed silently when it should fail.
The more typical pattern for functions in abstract types is to either (a) not define them so that they fail, or (b) implement a function that fails. My preference is for (b), since it also provides the opportunity to document. So recommended to replace the above with:
The text was updated successfully, but these errors were encountered: