mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
script: add CanGc
argument to Promise::new_resolved
and Promise::new_rejected
(#35605)
* add CanGc to new_resolved and use it where possible Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> * add CanGc to new_rejected Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com> --------- Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
This commit is contained in:
parent
dd13342f18
commit
adb831eefe
8 changed files with 23 additions and 29 deletions
|
@ -153,6 +153,7 @@ impl Promise {
|
|||
global: &GlobalScope,
|
||||
cx: SafeJSContext,
|
||||
value: impl ToJSValConvertible,
|
||||
_can_gc: CanGc,
|
||||
) -> Rc<Promise> {
|
||||
let _ac = JSAutoRealm::new(*cx, global.reflector().get_jsobject().get());
|
||||
unsafe {
|
||||
|
@ -170,6 +171,7 @@ impl Promise {
|
|||
global: &GlobalScope,
|
||||
cx: SafeJSContext,
|
||||
value: impl ToJSValConvertible,
|
||||
_can_gc: CanGc,
|
||||
) -> Rc<Promise> {
|
||||
let _ac = JSAutoRealm::new(*cx, global.reflector().get_jsobject().get());
|
||||
unsafe {
|
||||
|
@ -400,6 +402,6 @@ impl PromiseHelpers<crate::DomTypeHolder> for Promise {
|
|||
cx: SafeJSContext,
|
||||
value: impl ToJSValConvertible,
|
||||
) -> Rc<Promise> {
|
||||
Promise::new_resolved(global, cx, value)
|
||||
Promise::new_resolved(global, cx, value, CanGc::note())
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue