-
Notifications
You must be signed in to change notification settings - Fork 26.2k
bundle of 3 ngtsc fixes for the Material app #25425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
When an Angular decorated class is inherited, it might be the case that the entire inheritance chain actually has no constructor defined. In that event, a factory which simply instantiates the type without any arguments should be used.
A small bug caused base factory variable statements for @component to not be emitted properly. At the same time as this is fixed, those statements are now emitted as const.
You can preview 4fa9e3a at https://pr25425-4fa9e3a.ngbuilds.io/. |
throw new Error(`Type ${proto.name} does not support inheritance`); | ||
if (factory !== null) { | ||
return factory; | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for else
after return
if you care about that d:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very true :) I actually prefer the else
here, though.
In general, if the two cases are "equal" in the sense that they're both fundamental branches of the logic, I write the else
case out explicitly.
If the if
branch is handling some special case by doing an early return, though, and the else
case really represents the main flow of the logic, then I'll allow the if
to fall through and not explicitly wrap the main logic with else
.
A small bug caused base factory variable statements for @component to not be emitted properly. At the same time as this is fixed, those statements are now emitted as const. PR Close #25425
When an Angular decorated class is inherited, it might be the case that the entire inheritance chain actually has no constructor defined. In that event, a factory which simply instantiates the type without any arguments should be used. PR Close angular#25425
) A small bug caused base factory variable statements for @component to not be emitted properly. At the same time as this is fixed, those statements are now emitted as const. PR Close angular#25425
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.