mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
Add new consructor with &JSAutoCompartment parameter
This commit is contained in:
parent
782b58587a
commit
c7c174f837
1 changed files with 5 additions and 0 deletions
|
@ -79,6 +79,11 @@ impl Drop for Promise {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Promise {
|
impl Promise {
|
||||||
|
#[allow(unsafe_code)]
|
||||||
|
pub fn new(global: &GlobalScope, _comp: &JSAutoCompartment) -> Rc<Promise> {
|
||||||
|
unsafe { Promise::new_in_current_compartment(global) }
|
||||||
|
}
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
pub unsafe fn new_in_current_compartment(global: &GlobalScope) -> Rc<Promise> {
|
pub unsafe fn new_in_current_compartment(global: &GlobalScope) -> Rc<Promise> {
|
||||||
let cx = global.get_cx();
|
let cx = global.get_cx();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue