script: Always pass &mut JSContext to Constructor - #46040
Merged
Conversation
Ports all relevant constructors that are generated bindings to pass a `&mut JSContext` rather than `can_gc`. It got a bit out of hand as I underestimated the amount of affected constructors. However, all of it is purely mechanical, so should be straightforward to review. Part of servo#40600 Testing: it compiles Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
sagudev
approved these changes
Jun 27, 2026
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
TimvdLippe
enabled auto-merge
June 27, 2026 21:10
Signed-off-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
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.
Ports all relevant constructors that are generated bindings to pass a
&mut JSContextrather thancan_gc. It got a bit out of hand as I underestimated the amount of affected constructors. However, all of it is purely mechanical, so should be straightforward to review.It also updates some of the ordering of determining which argument type to pass. Since realms have higher priority than just JSContext, these are also now checked first. This is required since 1 Constructor is marked as
realmand otherwise it would have always taken aJSContextsince that would be checked first.Part of #40600
Testing: it compiles