Always pass InRealm to GlobalScope::from_context to avoid getting null global

This commit is contained in:
CYBAI 2020-01-24 12:43:49 +09:00
parent 795dab71ff
commit 403ffcf1eb
16 changed files with 79 additions and 61 deletions

View file

@ -673,7 +673,7 @@ impl WindowMethods for Window {
}
// https://html.spec.whatwg.org/multipage/#dom-opener
fn Opener(&self, cx: JSContext) -> JSVal {
fn Opener(&self, cx: JSContext, in_realm_proof: InRealm) -> JSVal {
// Step 1, Let current be this Window object's browsing context.
let current = match self.window_proxy.get() {
Some(proxy) => proxy,
@ -688,7 +688,7 @@ impl WindowMethods for Window {
return NullValue();
}
// Step 3 to 5.
current.opener(*cx)
current.opener(*cx, in_realm_proof)
}
#[allow(unsafe_code)]