Bug 1271653 - DebuggerObject.global should return a DebuggerObject;r=fitzgen

This commit is contained in:
Eddy Bruel 2016-06-21 11:14:45 +02:00
parent de6084520f
commit f182cfb7be
2 changed files with 10 additions and 5 deletions

View File

@ -8128,7 +8128,7 @@ DebuggerObject::globalGetter(JSContext* cx, unsigned argc, Value* vp)
{
THIS_DEBUGOBJECT(cx, argc, vp, "get global", args, object)
RootedObject result(cx);
Rooted<DebuggerObject*> result(cx);
if (!DebuggerObject::global(cx, object, &result))
return false;
@ -8882,13 +8882,18 @@ DebuggerObject::className(JSContext* cx, Handle<DebuggerObject*> object,
}
/* static */ bool
DebuggerObject::global(JSContext* cx, Handle<DebuggerObject*> object, MutableHandleObject result)
DebuggerObject::global(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandle<DebuggerObject*> result)
{
RootedObject referent(cx, object->referent());
Debugger* dbg = object->owner();
result.set(&referent->global());
return dbg->wrapDebuggeeObject(cx, result);
RootedObject global(cx, &referent->global());
if (!dbg->wrapDebuggeeObject(cx, &global))
return false;
result.set(&global->as<DebuggerObject>());
return true;
}
/* static */ bool

View File

@ -1072,7 +1072,7 @@ class DebuggerObject : public NativeObject
static MOZ_MUST_USE bool className(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleString result);
static MOZ_MUST_USE bool global(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleObject result);
MutableHandle<DebuggerObject*> result);
static MOZ_MUST_USE bool name(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleString result);
static MOZ_MUST_USE bool displayName(JSContext* cx, Handle<DebuggerObject*> object,