Bug 1472973 part 9 - Use JS::GetNonCCWObjectGlobal in worker wrap-callback. r=bz

This commit is contained in:
Jan de Mooij 2018-07-06 18:16:24 +02:00
parent e918a3c855
commit 2de712fd5c

View File

@ -903,7 +903,8 @@ Wrap(JSContext *cx, JS::HandleObject existing, JS::HandleObject obj)
MOZ_CRASH("There should be no edges from the debuggee to the debugger.");
}
JSObject* originGlobal = js::GetGlobalForObjectCrossCompartment(obj);
// Note: the JS engine unwraps CCWs before calling this callback.
JSObject* originGlobal = JS::GetNonCCWObjectGlobal(obj);
const js::Wrapper* wrapper = nullptr;
if (IsWorkerDebuggerGlobal(originGlobal) ||