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

This commit is contained in:
Eddy Bruel 2016-06-21 11:20:58 +02:00
Родитель f182cfb7be
Коммит 4fa8fd2f03
2 изменённых файлов: 10 добавлений и 6 удалений

Просмотреть файл

@ -8076,11 +8076,11 @@ DebuggerObject::boundTargetFunctionGetter(JSContext* cx, unsigned argc, Value* v
return true;
}
RootedObject result(cx);
Rooted<DebuggerObject*> result(cx);
if (!DebuggerObject::boundTargetFunction(cx, object, &result))
return false;
args.rval().setObjectOrNull(result);
args.rval().setObject(*result);
return true;
}
@ -8956,15 +8956,19 @@ DebuggerObject::parameterNames(JSContext* cx, Handle<DebuggerObject*> object,
/* static */ bool
DebuggerObject::boundTargetFunction(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleObject result)
MutableHandle<DebuggerObject*> result)
{
MOZ_ASSERT(isBoundFunction(cx, object));
RootedFunction referent(cx, &object->referent()->as<JSFunction>());
Debugger* dbg = object->owner();
result.set(referent->getBoundFunctionTarget());
return dbg->wrapDebuggeeObject(cx, result);
RootedObject target(cx, referent->getBoundFunctionTarget());
if (!dbg->wrapDebuggeeObject(cx, &target))
return false;
result.set(&target->as<DebuggerObject>());
return true;
}
/* static */ bool

Просмотреть файл

@ -1080,7 +1080,7 @@ class DebuggerObject : public NativeObject
static MOZ_MUST_USE bool parameterNames(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandle<StringVector> result);
static MOZ_MUST_USE bool boundTargetFunction(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleObject result);
MutableHandle<DebuggerObject*> result);
static MOZ_MUST_USE bool boundThis(JSContext* cx, Handle<DebuggerObject*> object,
MutableHandleValue result);
static MOZ_MUST_USE bool boundArguments(JSContext* cx, Handle<DebuggerObject*> object,