mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Use Heap in DOM object reflector implementation to ensure GC barriers are used.
This commit is contained in:
parent
be3f35878a
commit
e5eaab3523
4 changed files with 19 additions and 26 deletions
|
@ -90,12 +90,12 @@ impl Promise {
|
|||
#[allow(unsafe_code, unrooted_must_root)]
|
||||
unsafe fn new_with_js_promise(obj: HandleObject, cx: *mut JSContext) -> Rc<Promise> {
|
||||
assert!(IsPromiseObject(obj));
|
||||
let mut promise = Promise {
|
||||
let promise = Promise {
|
||||
reflector: Reflector::new(),
|
||||
permanent_js_root: MutHeapJSVal::new(),
|
||||
};
|
||||
promise.init_reflector(obj.get());
|
||||
let promise = Rc::new(promise);
|
||||
let mut promise = Rc::new(promise);
|
||||
Rc::get_mut(&mut promise).unwrap().init_reflector(obj.get());
|
||||
promise.initialize(cx);
|
||||
promise
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue