mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make Promise::Reject and Resolve take a &GlobalScope
This commit is contained in:
parent
26455b8a67
commit
02d38e74e9
4 changed files with 12 additions and 11 deletions
|
@ -163,10 +163,12 @@ pub unsafe fn global_root_from_context(cx: *mut JSContext) -> GlobalRoot {
|
|||
|
||||
/// Returns the global object of the realm that the given JS object was created in,
|
||||
/// after unwrapping any wrappers.
|
||||
pub unsafe fn global_root_from_object_maybe_wrapped(mut obj: *mut JSObject) -> GlobalRoot {
|
||||
pub unsafe fn global_scope_from_object_maybe_wrapped(
|
||||
mut obj: *mut JSObject)
|
||||
-> Root<GlobalScope> {
|
||||
if IsWrapper(obj) {
|
||||
obj = UnwrapObject(obj, /* stopAtWindowProxy = */ 0);
|
||||
assert!(!obj.is_null());
|
||||
}
|
||||
global_root_from_object(obj)
|
||||
global_scope_from_object(obj)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue