зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1259877 - Rename Invoke[GS]etter to Call[GS]etter, more in line with the spec's calling nomenclature. r=jorendorff
--HG-- extra : rebase_source : 4a810f7b6b6fc6a9849b827b8a593251e02cc915
This commit is contained in:
Родитель
7e3a50ba41
Коммит
3ef9bb2477
|
@ -139,7 +139,8 @@ BaseProxyHandler::get(JSContext* cx, HandleObject proxy, HandleValue receiver,
|
|||
}
|
||||
|
||||
// Step 7.
|
||||
return InvokeGetter(cx, receiver, ObjectValue(*getter), vp);
|
||||
RootedValue getterFunc(cx, ObjectValue(*getter));
|
||||
return CallGetter(cx, receiver, getterFunc, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -241,7 +242,7 @@ js::SetPropertyIgnoringNamedGetter(JSContext* cx, HandleObject obj, HandleId id,
|
|||
if (!setter)
|
||||
return result.fail(JSMSG_GETTER_ONLY);
|
||||
RootedValue setterValue(cx, ObjectValue(*setter));
|
||||
if (!InvokeSetter(cx, receiver, setterValue, v))
|
||||
if (!CallSetter(cx, receiver, setterValue, v))
|
||||
return false;
|
||||
return result.succeed();
|
||||
}
|
||||
|
|
|
@ -629,24 +629,22 @@ js::InternalConstructWithProvidedThis(JSContext* cx, HandleValue fval, HandleVal
|
|||
}
|
||||
|
||||
bool
|
||||
js::InvokeGetter(JSContext* cx, const Value& thisv, Value fval, MutableHandleValue rval)
|
||||
js::CallGetter(JSContext* cx, HandleValue thisv, HandleValue getter, MutableHandleValue rval)
|
||||
{
|
||||
/*
|
||||
* Invoke could result in another try to get or set the same id again, see
|
||||
* bug 355497.
|
||||
*/
|
||||
// Invoke could result in another try to get or set the same id again, see
|
||||
// bug 355497.
|
||||
JS_CHECK_RECURSION(cx, return false);
|
||||
|
||||
return Invoke(cx, thisv, fval, 0, nullptr, rval);
|
||||
return Invoke(cx, thisv, getter, 0, nullptr, rval);
|
||||
}
|
||||
|
||||
bool
|
||||
js::InvokeSetter(JSContext* cx, const Value& thisv, Value fval, HandleValue v)
|
||||
js::CallSetter(JSContext* cx, HandleValue thisv, HandleValue setter, HandleValue v)
|
||||
{
|
||||
JS_CHECK_RECURSION(cx, return false);
|
||||
|
||||
RootedValue ignored(cx);
|
||||
return Invoke(cx, thisv, fval, 1, v.address(), &ignored);
|
||||
return Invoke(cx, thisv, setter, 1, v.address(), &ignored);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -74,10 +74,10 @@ Invoke(JSContext* cx, const Value& thisv, const Value& fval, unsigned argc, cons
|
|||
* getter/setter calls.
|
||||
*/
|
||||
extern bool
|
||||
InvokeGetter(JSContext* cx, const Value& thisv, Value fval, MutableHandleValue rval);
|
||||
CallGetter(JSContext* cx, HandleValue thisv, HandleValue getter, MutableHandleValue rval);
|
||||
|
||||
extern bool
|
||||
InvokeSetter(JSContext* cx, const Value& thisv, Value fval, HandleValue v);
|
||||
CallSetter(JSContext* cx, HandleValue thisv, HandleValue setter, HandleValue rval);
|
||||
|
||||
// ES6 7.3.13 Construct(F, argumentsList, newTarget). All parameters are
|
||||
// required, hopefully forcing callers to be careful not to (say) blindly pass
|
||||
|
|
|
@ -1731,8 +1731,8 @@ CallGetter(JSContext* cx, HandleObject obj, HandleValue receiver, HandleShape sh
|
|||
MOZ_ASSERT(!shape->hasDefaultGetter());
|
||||
|
||||
if (shape->hasGetterValue()) {
|
||||
Value fval = shape->getterValue();
|
||||
return InvokeGetter(cx, receiver, fval, vp);
|
||||
RootedValue getter(cx, shape->getterValue());
|
||||
return js::CallGetter(cx, receiver, getter, vp);
|
||||
}
|
||||
|
||||
// In contrast to normal getters JSGetterOps always want the holder.
|
||||
|
@ -2348,9 +2348,11 @@ SetExistingProperty(JSContext* cx, HandleNativeObject obj, HandleId id, HandleVa
|
|||
MOZ_ASSERT_IF(!shape->hasSetterObject(), shape->hasDefaultSetter());
|
||||
if (shape->hasDefaultSetter())
|
||||
return result.fail(JSMSG_GETTER_ONLY);
|
||||
Value setter = ObjectValue(*shape->setterObject());
|
||||
if (!InvokeSetter(cx, receiver, setter, v))
|
||||
|
||||
RootedValue setter(cx, ObjectValue(*shape->setterObject()));
|
||||
if (!js::CallSetter(cx, receiver, setter, v))
|
||||
return false;
|
||||
|
||||
return result.succeed();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче