mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +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
|
@ -18,6 +18,7 @@ use dom::bindings::error::{Error, Fallible};
|
|||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::MutHeapJSVal;
|
||||
use dom::bindings::reflector::{Reflectable, MutReflectable, Reflector};
|
||||
use dom::globalscope::GlobalScope;
|
||||
use dom::promisenativehandler::PromiseNativeHandler;
|
||||
use js::conversions::ToJSValConvertible;
|
||||
use js::jsapi::{CallOriginalPromiseResolve, CallOriginalPromiseReject, CallOriginalPromiseThen};
|
||||
|
@ -70,7 +71,7 @@ impl Drop for Promise {
|
|||
|
||||
impl Promise {
|
||||
#[allow(unsafe_code)]
|
||||
pub fn new(global: GlobalRef) -> Rc<Promise> {
|
||||
pub fn new(global: &GlobalScope) -> Rc<Promise> {
|
||||
let cx = global.get_cx();
|
||||
rooted!(in(cx) let mut obj = ptr::null_mut());
|
||||
unsafe {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue