mirror of
https://github.com/servo/servo
synced 2026-05-09 00:22:16 +02:00
At the start of the script we create first (and only[^1]) safe `JSContext`, from where we should pass it down to every code that needs the cx. This PR brings it all the way down to message handlers. There is clear separation between functions that use new model `&mut JSContext` and the ones that use the old model (usually they take can_gc). [^1]: Another place of construction are SM hooks (that pass us down raw JSContext), but to reach that point we already needed to call another function that takes `&mut JSContext`, so one can look at this case as reentering/reborrowing (we derive new shorter `&mut JSContext` from the old one). Testing: This is just refactor, but should covered by WPT tests. Part of #40600 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>