mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Make Promise::new take a &GlobalScope
This commit is contained in:
parent
a8c05c6962
commit
ac5a4adf5f
5 changed files with 11 additions and 9 deletions
|
@ -276,7 +276,7 @@ fn canonicalize_filter(filter: &BluetoothRequestDeviceFilter) -> Fallible<Blueto
|
|||
pub fn result_to_promise<T: ToJSValConvertible>(global_ref: GlobalRef,
|
||||
bluetooth_result: Fallible<T>)
|
||||
-> Rc<Promise> {
|
||||
let p = Promise::new(global_ref);
|
||||
let p = Promise::new(global_ref.as_global_scope());
|
||||
match bluetooth_result {
|
||||
Ok(v) => p.resolve_native(p.global().r().get_cx(), &v),
|
||||
Err(e) => p.reject_error(p.global().r().get_cx(), e),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue