Make Promise::new take a &GlobalScope

This commit is contained in:
Anthony Ramine 2016-10-01 21:00:17 +02:00
parent a8c05c6962
commit ac5a4adf5f
5 changed files with 11 additions and 9 deletions

View file

@ -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),