Bug 693469 - 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 7d613942b0
commit cb28ecfc4b
30 changed files with 180 additions and 95 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"
@@ -79,6 +82,7 @@
#include "vm/Stack-inl.h"
#include "vm/String-inl.h"
using namespace mozilla;
using namespace js;
using namespace js::gc;
@@ -160,7 +164,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)