aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_runtime.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-02-16 23:09:50 -0500
committerJosh Matthews <josh@joshmatthews.net>2023-05-20 11:05:09 -0400
commitf79e1e327dfdf047cab9652e1cc3e67a7667faa1 (patch)
tree43c1cf48c9a6448264722780e38315dafacf4a24 /components/script/script_runtime.rs
parent4998c65c423f995149f4b314d8ff68024c24cc72 (diff)
downloadservo-f79e1e327dfdf047cab9652e1cc3e67a7667faa1.tar.gz
servo-f79e1e327dfdf047cab9652e1cc3e67a7667faa1.zip
Make GlobalScope.get_cx a static method.
Diffstat (limited to 'components/script/script_runtime.rs')
-rw-r--r--components/script/script_runtime.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/script_runtime.rs b/components/script/script_runtime.rs
index d9566f6b204..59cbdc77ba3 100644
--- a/components/script/script_runtime.rs
+++ b/components/script/script_runtime.rs
@@ -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();