-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chore: Remove Object.assign from TS files #4389
Conversation
Codecov Report
@@ Coverage Diff @@
## feat/typescript #4389 +/- ##
===================================================
- Coverage 98.65% 98.65% -0.01%
===================================================
Files 93 94 +1
Lines 5947 5937 -10
Branches 795 795
===================================================
- Hits 5867 5857 -10
Misses 79 79
Partials 1 1
Continue to review full report at Codecov.
|
All 621 screenshot tests passed for commit b9e2f69 vs. |
All 621 screenshot tests passed for commit 532cb43 vs. |
All 621 screenshot tests passed for commit 3a16936 vs. |
All 621 screenshot tests passed for commit 5ed52c0 vs. |
All 621 screenshot tests passed for commit a2a42cf vs. |
@@ -44,8 +44,10 @@ class MDCGridListFoundation extends MDCFoundation<MDCGridListAdapter> { | |||
private readonly resizeHandler_: EventListener; | |||
private resizeFrame_ = 0; | |||
|
|||
constructor(adapter: MDCGridListAdapter) { | |||
super(Object.assign(MDCGridListFoundation.defaultAdapter, adapter)); | |||
/* istanbul ignore next: optional argument is not a branch statement */ |
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.
Is ignore next
still necessary without a default assignment? I don't see it on the other constructors using an optional argument.
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.
I'm honestly not sure why it's needed in some places but not others.
I've noticed that it's usually needed when a base foundation is subclassed by another foundation that doesn't have its own constructor (e.g., tab-scroller), but this case I have no idea.
My only guess is that it's a quirk in Istanbul.
@@ -51,6 +51,7 @@ class MDCComponent<FoundationType extends MDCFoundation> { | |||
this.initialSyncWithDOM(); | |||
} | |||
|
|||
/* istanbul ignore next: method param only exists for typing purposes; it does not need to be unit tested */ |
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.
What is this comment skipping? There's no default assignment and I don't see any conditionals in the output code... shouldn't this end up hit during our unit tests anyway?
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.
Welcome to Istanbul 😛 If you remove this comment, code coverage drops on certain components. Don't ask me to explain it, cuz I gave up trying to figure it out after 30 min of banging my head against a wall.
…ion indentation instead of 4
All 621 screenshot tests passed for commit 9e94771 vs. |
Refs #4225
This PR improves consistency across TS files:
Object.assign()
with{...spread}
operatorPartial<MDCFooAdapter>
ponyfill.matches()
frommdc-dom
instead ofgetMatchesProperty()
frommdc-ripple
getMatchesProperty()
still exists to avoid breaking backward compatibility, but it is no longer used in TSevt
,evtType
, and<K extends EventType>
/index
(e.g.,@material/foo/index
instead of@material/foo
)