Bug 639469 - Use mozilla::ArrayLength and mozilla::ArrayEnd in preference to JS_ARRAY_LENGTH whenever possible. r=cjones

This commit is contained in:
Jeff Walden
2011-10-10 23:00:28 -07:00
parent 946f2ae0e3
commit 9dc00cdc62
30 changed files with 177 additions and 92 deletions

View File

@@ -42,6 +42,9 @@
* JavaScript iterators.
*/
#include <string.h> /* for memcpy */
#include "mozilla/Util.h"
#include "jstypes.h"
#include "jsstdint.h"
#include "jsutil.h"
@@ -80,6 +83,7 @@
#include "vm/Stack-inl.h"
#include "vm/String-inl.h"
using namespace mozilla;
using namespace js;
using namespace js::gc;
@@ -161,7 +165,7 @@ static inline bool
NewKeyValuePair(JSContext *cx, jsid id, const Value &val, Value *rval)
{
Value vec[2] = { IdToValue(id), val };
AutoArrayRooter tvr(cx, JS_ARRAY_LENGTH(vec), vec);
AutoArrayRooter tvr(cx, ArrayLength(vec), vec);
JSObject *aobj = NewDenseCopiedArray(cx, 2, vec);
if (!aobj)