Make GlobalScope.get_cx a static method.

This commit is contained in:
Josh Matthews 2023-02-16 23:09:50 -05:00
parent 4998c65c42
commit f79e1e327d
39 changed files with 132 additions and 127 deletions

View file

@ -297,7 +297,7 @@ unsafe extern "C" fn promise_rejection_tracker(
global.dom_manipulation_task_source().queue(
task!(rejection_handled_event: move || {
let target = target.root();
let cx = target.global().get_cx();
let cx = GlobalScope::get_cx();
let root_promise = trusted_promise.root();
rooted!(in(*cx) let mut reason = UndefinedValue());
@ -324,7 +324,7 @@ unsafe extern "C" fn promise_rejection_tracker(
#[allow(unsafe_code, unrooted_must_root)]
/// https://html.spec.whatwg.org/multipage/#notify-about-rejected-promises
pub fn notify_about_rejected_promises(global: &GlobalScope) {
let cx = global.get_cx();
let cx = GlobalScope::get_cx();
unsafe {
// Step 2.
if global.get_uncaught_rejections().borrow().len() > 0 {
@ -350,7 +350,7 @@ pub fn notify_about_rejected_promises(global: &GlobalScope) {
global.dom_manipulation_task_source().queue(
task!(unhandled_rejection_event: move || {
let target = target.root();
let cx = target.global().get_cx();
let cx = GlobalScope::get_cx();
for promise in uncaught_rejections {
let promise = promise.root();