diff options
author | Aron Zwaan <aronzwaan@gmail.com> | 2019-03-30 21:03:20 +0100 |
---|---|---|
committer | Aron Zwaan <aronzwaan@gmail.com> | 2019-04-03 20:45:30 +0200 |
commit | 782b58587acc754c7b378a84a4b51405738bb081 (patch) | |
tree | a530be8317cbda75e8d81679a7abc9fbd6379541 /components/script/dom/testbinding.rs | |
parent | 6fa1853bb1e9bc80271c5259a8d2ed7799a0d6ff (diff) | |
download | servo-782b58587acc754c7b378a84a4b51405738bb081.tar.gz servo-782b58587acc754c7b378a84a4b51405738bb081.zip |
Rename Promise::new to Promise::new_in_current_compartment
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r-- | components/script/dom/testbinding.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 505e51325a9..f5d64a478de 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -1009,6 +1009,7 @@ impl TestBindingMethods for TestBinding { ); } + #[allow(unsafe_code)] fn PromiseNativeHandler( &self, resolve: Option<Rc<SimpleCallback>>, @@ -1020,7 +1021,7 @@ impl TestBindingMethods for TestBinding { resolve.map(SimpleHandler::new), reject.map(SimpleHandler::new), ); - let p = Promise::new(&global); + let p = unsafe { Promise::new_in_current_compartment(&global) }; p.append_native_handler(&handler); return p; @@ -1043,8 +1044,9 @@ impl TestBindingMethods for TestBinding { } } + #[allow(unsafe_code)] fn PromiseAttribute(&self) -> Rc<Promise> { - Promise::new(&self.global()) + unsafe { Promise::new_in_current_compartment(&self.global()) } } fn AcceptPromise(&self, _promise: &Promise) {} |