-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
[Merged by Bors] - Fix destructive for-of loop assignments #2803
Conversation
Test262 conformance changes
Fixed tests (86):
|
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.
Nice work! Just a small suggestion.
context | ||
.vm | ||
.frame_mut() | ||
.iterators | ||
.last_mut() | ||
.expect("iterator on the call frame must exist") | ||
.1 = done; |
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.
Seeing that we're now storing the current iterator directly in the vm frame, maybe we should leverage that and remove pushing the iterator to the stack?
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.
Yes I also thought about that. I would push that until we have figured out how this works in all scenarios. This current closing of iterators works because it is limited to the destructing assignment iterators. We have to extend this to the iterators of the for-of loop itself too. When doing that we have to adjust for async iterators and control flows.
When we have solved those issues, I think we should be able to just switch over the iterator objects from the stack to the frame.
Codecov Report
@@ Coverage Diff @@
## main #2803 +/- ##
==========================================
- Coverage 51.40% 51.34% -0.06%
==========================================
Files 416 416
Lines 41080 41312 +232
==========================================
+ Hits 21117 21213 +96
- Misses 19963 20099 +136
... and 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
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.
Got it! We can revisit this later when we have more information about the execution patterns of for loops :)
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.
Looks great! :)
Just a small suggestion
bors r+ |
This Pull Request changes the following: - Fix the assignment of variables in destructive for-of initializers. - Fix the environment handling in the compilation of `for-of/in` loops. - Close iterators in destructive for-of loop assignments, when the code throws during the assignment.
Pull request successfully merged into main. Build succeeded: |
This Pull Request changes the following:
for-of/in
loops.