mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 650161 - Fix sandbox object moved hook to work on partly initialized object r=bholley
This commit is contained in:
parent
bcda188339
commit
951df42fa0
@ -327,10 +327,13 @@ sandbox_finalize(js::FreeOp *fop, JSObject *obj)
|
||||
static void
|
||||
sandbox_moved(JSObject *obj, const JSObject *old)
|
||||
{
|
||||
// Note that this hook can be called before the private pointer is set. In
|
||||
// this case the SandboxPrivate will not exist yet, so there is nothing to
|
||||
// do.
|
||||
nsIScriptObjectPrincipal *sop =
|
||||
static_cast<nsIScriptObjectPrincipal *>(xpc_GetJSPrivate(obj));
|
||||
MOZ_ASSERT(sop);
|
||||
static_cast<SandboxPrivate *>(sop)->ObjectMoved(obj, old);
|
||||
if (sop)
|
||||
static_cast<SandboxPrivate *>(sop)->ObjectMoved(obj, old);
|
||||
}
|
||||
|
||||
static bool
|
||||
|
Loading…
Reference in New Issue
Block a user