Bug 711895 - Tweak the warning options used for GCC builds. r=waldo, derf.
This commit is contained in:
@@ -404,11 +404,24 @@ DoGetElement(JSContext *cx, JSObject *obj, uint32_t index, JSBool *hole, Value *
|
||||
return true;
|
||||
}
|
||||
|
||||
template<typename IndexType>
|
||||
static void
|
||||
AssertGreaterThanZero(IndexType index)
|
||||
{
|
||||
JS_ASSERT(index >= 0);
|
||||
}
|
||||
|
||||
template<>
|
||||
void
|
||||
AssertGreaterThanZero(jsuint index)
|
||||
{
|
||||
}
|
||||
|
||||
template<typename IndexType>
|
||||
static JSBool
|
||||
GetElement(JSContext *cx, JSObject *obj, IndexType index, JSBool *hole, Value *vp)
|
||||
{
|
||||
JS_ASSERT(index >= 0);
|
||||
AssertGreaterThanZero(index);
|
||||
if (obj->isDenseArray() && index < obj->getDenseArrayInitializedLength() &&
|
||||
!(*vp = obj->getDenseArrayElement(uint32_t(index))).isMagic(JS_ARRAY_HOLE)) {
|
||||
*hole = JS_FALSE;
|
||||
|
||||
Reference in New Issue
Block a user