зеркало из https://github.com/mozilla/pjs.git
Bug 676738 - Change the index argument to JS_SetElement from jsint to uint32. r=dmandelin
This commit is contained in:
Родитель
bb81c3d126
Коммит
8879cedf90
|
@ -249,7 +249,7 @@ nsFrameMessageManager::SendSyncMessage()
|
|||
NS_ENSURE_TRUE(dataArray, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
||||
for (PRUint32 i = 0; i < len; ++i) {
|
||||
if (!retval[i].Length())
|
||||
if (retval[i].IsEmpty())
|
||||
continue;
|
||||
|
||||
jsval ret = JSVAL_VOID;
|
||||
|
|
|
@ -9860,12 +9860,7 @@ nsHTMLPluginObjElementSH::SetProperty(nsIXPConnectWrappedNative *wrapper,
|
|||
}
|
||||
|
||||
if (found) {
|
||||
if (JSID_IS_STRING(id)) {
|
||||
*_retval = ::JS_SetPropertyById(cx, pi_obj, id, vp);
|
||||
} else {
|
||||
*_retval = ::JS_SetElement(cx, pi_obj, JSID_TO_INT(id), vp);
|
||||
}
|
||||
|
||||
*_retval = ::JS_SetPropertyById(cx, pi_obj, id, vp);
|
||||
return *_retval ? NS_SUCCESS_I_DID_SOMETHING : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,8 +98,7 @@ ConvertCloneBuffersToArrayInternal(
|
|||
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
||||
}
|
||||
|
||||
jsint count = jsint(aBuffers.Length());
|
||||
for (jsint index = 0; index < count; index++) {
|
||||
for (uint32 index = 0, count = aBuffers.Length(); index < count; index++) {
|
||||
JSAutoStructuredCloneBuffer& buffer = aBuffers[index];
|
||||
|
||||
jsval val;
|
||||
|
|
|
@ -924,8 +924,7 @@ GetAllKeysHelper::GetSuccessResult(JSContext* aCx,
|
|||
return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
|
||||
}
|
||||
|
||||
jsint count = jsint(keys.Length());
|
||||
for (jsint index = 0; index < count; index++) {
|
||||
for (uint32 index = 0, count = keys.Length(); index < count; index++) {
|
||||
const Key& key = keys[index];
|
||||
NS_ASSERTION(!key.IsUnset(), "Bad key!");
|
||||
|
||||
|
|
|
@ -3773,8 +3773,12 @@ JS_SetPropertyById(JSContext *cx, JSObject *obj, jsid id, jsval *vp)
|
|||
}
|
||||
|
||||
JS_PUBLIC_API(JSBool)
|
||||
JS_SetElement(JSContext *cx, JSObject *obj, jsint index, jsval *vp)
|
||||
JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp)
|
||||
{
|
||||
CHECK_REQUEST(cx);
|
||||
jsid id;
|
||||
if (!IndexToId(cx, index, &id))
|
||||
return false;
|
||||
return JS_SetPropertyById(cx, obj, INT_TO_JSID(index), vp);
|
||||
}
|
||||
|
||||
|
|
|
@ -2502,7 +2502,7 @@ extern JS_PUBLIC_API(JSBool)
|
|||
JS_GetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_SetElement(JSContext *cx, JSObject *obj, jsint index, jsval *vp);
|
||||
JS_SetElement(JSContext *cx, JSObject *obj, uint32 index, jsval *vp);
|
||||
|
||||
extern JS_PUBLIC_API(JSBool)
|
||||
JS_DeleteElement(JSContext *cx, JSObject *obj, uint32 index);
|
||||
|
|
|
@ -2054,7 +2054,7 @@ ethogram_getAllEvents(JSContext *cx, uintN argc, jsval *vp)
|
|||
|
||||
JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(rarray));
|
||||
|
||||
for (int i = 0; !p->isEmpty(); i++) {
|
||||
for (uint32 i = 0; !p->isEmpty(); i++) {
|
||||
|
||||
JSObject *x = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
if (x == NULL)
|
||||
|
|
|
@ -2471,7 +2471,7 @@ DumpStack(JSContext *cx, uintN argc, Value *vp)
|
|||
JS_ASSERT(iter.nativeArgs().callee().getFunctionPrivate()->native() == DumpStack);
|
||||
++iter;
|
||||
|
||||
jsint index = 0;
|
||||
uint32 index = 0;
|
||||
for (; !iter.done(); ++index, ++iter) {
|
||||
Value v;
|
||||
if (iter.isScript()) {
|
||||
|
@ -2698,7 +2698,6 @@ GetPDA(JSContext *cx, uintN argc, jsval *vp)
|
|||
JSBool ok;
|
||||
JSPropertyDescArray pda;
|
||||
JSPropertyDesc *pd;
|
||||
uint32 i;
|
||||
jsval v;
|
||||
|
||||
if (!JS_ValueToObject(cx, argc == 0 ? JSVAL_VOID : vp[2], &vobj))
|
||||
|
@ -2717,7 +2716,7 @@ GetPDA(JSContext *cx, uintN argc, jsval *vp)
|
|||
if (!ok)
|
||||
return JS_FALSE;
|
||||
pd = pda.array;
|
||||
for (i = 0; i < pda.length; i++, pd++) {
|
||||
for (uint32 i = 0; i < pda.length; i++, pd++) {
|
||||
pdobj = JS_NewObject(cx, NULL, NULL, NULL);
|
||||
if (!pdobj) {
|
||||
ok = JS_FALSE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче