-
-
Notifications
You must be signed in to change notification settings - Fork 4k
feat(collection): honour subclassing via @@species
in static methods
#10723
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
feat(collection): honour subclassing via @@species
in static methods
#10723
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
8166bd8
to
472b938
Compare
Can you add tests for this? |
Subclassing is currently not tested at all, which is why I didn't add any. If tests are desirable here, then they probably also need adding for the other methods as well? |
472b938
to
c2e4656
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #10723 +/- ##
==========================================
+ Coverage 38.00% 38.60% +0.59%
==========================================
Files 239 239
Lines 14894 14664 -230
Branches 1392 1390 -2
==========================================
Hits 5661 5661
+ Misses 9221 8991 -230
Partials 12 12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Please describe the changes this PR makes and why it should be merged:
Collection methods feature subclassing support via
Symbol.species
. This currently doesn't apply to the one static method, which calls the Collection constructor specifically.This change brings the behaviour of static methods in line with instance methods, such that
DerivedCollection.combineEntries(...)
returns a DerivedCollection, not a Collection.