feat: implement Iterator.zip and Iterator.zipKeyed (#4564) - #4946
Conversation
Test262 conformance changes
Tested main commit: |
| let iterables = args.get_or_undefined(0); | ||
| let options = args.get_or_undefined(1); | ||
|
|
||
| // 1. If iterables is not an Object, throw a TypeError exception. |
There was a problem hiding this comment.
issue: include the entire specification text.
| let mode = Self::parse_zip_mode(options, context)?; | ||
|
|
||
| // 6-7. Parse padding option (only for "longest" mode). | ||
| let padding_option = if mode == ZipMode::Longest { |
There was a problem hiding this comment.
suggestion: rewrite these using some if-let chains
| let mode = Self::parse_zip_mode(options, context)?; | ||
|
|
||
| // 6-7. Parse padding option. | ||
| let padding_option = if mode == ZipMode::Longest { |
There was a problem hiding this comment.
suggestion: use if-let chains here
| } | ||
| } | ||
|
|
||
| impl IntrinsicObject for ZipIterator { |
There was a problem hiding this comment.
nit: move this higher up in the file
|
Hey @nekevss, All review feedback addressed! (Added spec comments, refactored Ready for review. Thanks! |
|
All the implementation needs to be gated behind the |
99be867 to
cc4de18
Compare
|
Can you please review this once. Thanks! |
|
Also you didn't address some of Kevin's comments |
2612098 to
0993de3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4946 +/- ##
===========================================
+ Coverage 47.24% 62.42% +15.18%
===========================================
Files 476 534 +58
Lines 46892 59745 +12853
===========================================
+ Hits 22154 37296 +15142
+ Misses 24738 22449 -2289 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
PR is ready to review. Thanks! |
|
Looks like there may be some conflicts that need to be resolved |
# Conflicts: # core/engine/src/builtins/iterable/tests.rs
|
Please review the PR. |
jedel1043
left a comment
There was a problem hiding this comment.
I see a lot of unnecessary files like cargo_error or check_output. You should remove those.
…ch guard (mutation not allowed in guards)
|
can u please review this PR. |
|
@nekevss, PR is ready to merge plz take a review. |
jedel1043
left a comment
There was a problem hiding this comment.
Had to tweak and refactor a chunk of the implementation to put it closer to the rest of the iterator helpers, but looks good now.
Changes should have been addressed, and I want to merge this asap to fix the bugs
Implements the TC39 Joint Iteration proposal (#4564).
Adds Iterator.zip and Iterator.zipKeyed static methods with support for
"shortest", "longest", and "strict" modes. Includes a new ZipIterator
backing object with proper iterator protocol handling.