mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
Bug 1338126 - Rename compound HasProperty+GetProperty from GetElement to HasAndGetElement. r=evilpie
--HG-- extra : rebase_source : 9ac51201b6798ed4c22feed0d2e67c768e841e43 extra : histedit_source : 18cb79a5b7cc4fdfd5a69d91442fd7a8ed152c25
This commit is contained in:
parent
006bef6c2d
commit
1810ed04d8
@ -234,8 +234,8 @@ ToId(JSContext* cx, double index, MutableHandleId id)
|
||||
* |*hole| to false. Otherwise set |*hole| to true and |vp| to Undefined.
|
||||
*/
|
||||
static bool
|
||||
GetElement(JSContext* cx, HandleObject obj, HandleObject receiver, uint32_t index, bool* hole,
|
||||
MutableHandleValue vp)
|
||||
HasAndGetElement(JSContext* cx, HandleObject obj, HandleObject receiver, uint32_t index,
|
||||
bool* hole, MutableHandleValue vp)
|
||||
{
|
||||
if (index < GetAnyBoxedOrUnboxedInitializedLength(obj)) {
|
||||
vp.set(GetAnyBoxedOrUnboxedDenseElement(obj, index));
|
||||
@ -270,9 +270,10 @@ GetElement(JSContext* cx, HandleObject obj, HandleObject receiver, uint32_t inde
|
||||
}
|
||||
|
||||
static inline bool
|
||||
GetElement(JSContext* cx, HandleObject obj, uint32_t index, bool* hole, MutableHandleValue vp)
|
||||
HasAndGetElement(JSContext* cx, HandleObject obj, uint32_t index, bool* hole,
|
||||
MutableHandleValue vp)
|
||||
{
|
||||
return GetElement(cx, obj, obj, index, hole, vp);
|
||||
return HasAndGetElement(cx, obj, obj, index, hole, vp);
|
||||
}
|
||||
|
||||
bool
|
||||
@ -315,7 +316,7 @@ js::GetElementsWithAdder(JSContext* cx, HandleObject obj, HandleObject receiver,
|
||||
for (uint32_t i = begin; i < end; i++) {
|
||||
if (adder->getBehavior() == ElementAdder::CheckHasElemPreserveHoles) {
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, receiver, i, &hole, &val))
|
||||
if (!HasAndGetElement(cx, obj, receiver, i, &hole, &val))
|
||||
return false;
|
||||
if (hole) {
|
||||
adder->appendHole();
|
||||
@ -1019,7 +1020,7 @@ array_toSource(JSContext* cx, unsigned argc, Value* vp)
|
||||
for (uint32_t index = 0; index < length; index++) {
|
||||
bool hole;
|
||||
if (!CheckForInterrupt(cx) ||
|
||||
!GetElement(cx, obj, index, &hole, &elt)) {
|
||||
!HasAndGetElement(cx, obj, index, &hole, &elt)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1492,8 +1493,8 @@ js::array_reverse(JSContext* cx, unsigned argc, Value* vp)
|
||||
for (uint32_t i = 0, half = len / 2; i < half; i++) {
|
||||
bool hole, hole2;
|
||||
if (!CheckForInterrupt(cx) ||
|
||||
!GetElement(cx, obj, i, &hole, &lowval) ||
|
||||
!GetElement(cx, obj, len - i - 1, &hole2, &hival))
|
||||
!HasAndGetElement(cx, obj, i, &hole, &lowval) ||
|
||||
!HasAndGetElement(cx, obj, len - i - 1, &hole2, &hival))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -2035,7 +2036,7 @@ js::array_sort(JSContext* cx, unsigned argc, Value* vp)
|
||||
return false;
|
||||
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, i, &hole, &v))
|
||||
if (!HasAndGetElement(cx, obj, i, &hole, &v))
|
||||
return false;
|
||||
if (hole)
|
||||
continue;
|
||||
@ -2336,7 +2337,7 @@ js::array_shift(JSContext* cx, unsigned argc, Value* vp)
|
||||
if (!CheckForInterrupt(cx))
|
||||
return false;
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, i + 1, &hole, &value))
|
||||
if (!HasAndGetElement(cx, obj, i + 1, &hole, &value))
|
||||
return false;
|
||||
if (hole) {
|
||||
if (!DeletePropertyOrThrow(cx, obj, i))
|
||||
@ -2417,7 +2418,7 @@ js::array_unshift(JSContext* cx, unsigned argc, Value* vp)
|
||||
if (!CheckForInterrupt(cx))
|
||||
return false;
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, last, &hole, &value))
|
||||
if (!HasAndGetElement(cx, obj, last, &hole, &value))
|
||||
return false;
|
||||
if (hole) {
|
||||
if (!DeletePropertyOrThrow(cx, obj, upperIndex))
|
||||
@ -2496,7 +2497,7 @@ ArraySpliceCopy(JSContext* cx, HandleObject arr, HandleObject obj,
|
||||
|
||||
// Steps 11.b, 11.c.i.
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, actualStart + k, &hole, &fromValue))
|
||||
if (!HasAndGetElement(cx, obj, actualStart + k, &hole, &fromValue))
|
||||
return false;
|
||||
|
||||
// Step 11.c.
|
||||
@ -2636,7 +2637,7 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse
|
||||
|
||||
/* Steps 15.b.iii, 15.b.iv.1. */
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, from, &hole, &fromValue))
|
||||
if (!HasAndGetElement(cx, obj, from, &hole, &fromValue))
|
||||
return false;
|
||||
|
||||
/* Steps 15.b.iv. */
|
||||
@ -2720,7 +2721,7 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse
|
||||
|
||||
/* Steps 16.b.iii, 16.b.iv.1. */
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, from, &hole, &fromValue))
|
||||
if (!HasAndGetElement(cx, obj, from, &hole, &fromValue))
|
||||
return false;
|
||||
|
||||
/* Steps 16.b.iv. */
|
||||
@ -2873,7 +2874,7 @@ SliceSlowly(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end, Handl
|
||||
for (uint32_t slot = begin; slot < end; slot++) {
|
||||
bool hole;
|
||||
if (!CheckForInterrupt(cx) ||
|
||||
!GetElement(cx, obj, slot, &hole, &value))
|
||||
!HasAndGetElement(cx, obj, slot, &hole, &value))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -2901,7 +2902,7 @@ SliceSparse(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end, Handl
|
||||
MOZ_ASSERT(begin <= index && index < end);
|
||||
|
||||
bool hole;
|
||||
if (!GetElement(cx, obj, index, &hole, &value))
|
||||
if (!HasAndGetElement(cx, obj, index, &hole, &value))
|
||||
return false;
|
||||
|
||||
if (!hole && !DefineElement(cx, result, index - begin, value))
|
||||
@ -3044,7 +3045,7 @@ js::array_slice(JSContext* cx, unsigned argc, Value* vp)
|
||||
|
||||
/* Steps 10.a-b, and 10.c.i. */
|
||||
bool kNotPresent;
|
||||
if (!GetElement(cx, obj, k, &kNotPresent, &kValue))
|
||||
if (!HasAndGetElement(cx, obj, k, &kNotPresent, &kValue))
|
||||
return false;
|
||||
|
||||
/* Step 10.c. */
|
||||
|
Loading…
Reference in New Issue
Block a user