-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Port CanGC/InRealm methods to use &mut JSContext/CurrentRealm #42638
Copy link
Copy link
Open
Labels
E-less-complexStraightforward. Recommended for a new contributor.Straightforward. Recommended for a new contributor.
Description
In bindings.conf each "dom method" (the ones that are exposed in JS), have entries like this:
servo/components/script_bindings/codegen/Bindings.conf
Lines 152 to 155 in 2eeaf05
| 'CSSStyleSheet': { | |
| 'inRealms': ['Replace'], | |
| 'canGc': ['AddRule', 'DeleteRule', 'GetCssRules', 'GetRules', 'InsertRule', 'RemoveRule', 'Replace'], | |
| }, |
that adds the type (
CanGc or InRealm) to method.
To port to new model, we need to switch:
- from
InRealmto&mut CurrentRealmlike done in this commit: 0132fc0 - from
CanGcto&mut JSContextlike done in this commit: 36e5b32
Full demonstration PR is here: #42637
TASK: Select one file and port some methods, but please claim the file beforehand by writing a comment in this issue. If methods are used in other files feel free to skip them or make sure their users also get &mut JSContext (this is more advanced).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
E-less-complexStraightforward. Recommended for a new contributor.Straightforward. Recommended for a new contributor.