Add a safe wrapper around ForOfIterator#736
Open
simonwuelker wants to merge 2 commits intoservo:mainfrom
Open
Conversation
simonwuelker
commented
Apr 19, 2026
06fb7f6 to
8e8f6a4
Compare
Member
Author
|
Hmm need to investigate why this crashes in the |
84807d8 to
224e6ff
Compare
ForOfIterator more convenient to useForOfIterator
ccf0c8c to
ed4c4cb
Compare
Member
Author
|
This is ready for review now. Some jobs are not picked up by the runners, not sure what's up with that. |
Member
We are limited by number of concurrent mac runners (org wise), so it usually takes some time for them to get running. That is also way I canceled old CI runs, as they result will be thrown away anyway. |
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
ed4c4cb to
6d4a423
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ForOfIteratorimplementsfor .. ofiteration in spidermonkey. It holds stack roots and is a pain to use directly due to some weird shenanigans where bindgen adds extra padding to the struct for some LLVM versions. Its also hard to use in a crash-proof manner, becauseForOfIteratormust not be moved. We'd have toPin<Box<>>it to be safe, which adds overhead.This change instead adds
mozjs::rust::for_of, a function that takes a callback and usesForOfIteratorcorrectly so users don't have to worry about it.Testing: The iterator is used during conversion of IDL sequences, and its covered by WPT. I'm also using it for web animations locally.
Part of servo/servo#36950
Servo PR: servo/servo#44356