s/JS_TRUE/true/g; s/JS_FALSE/false/g. Following up on a request in bug 858677, r=lumpy
authorJeff Walden <jwalden@mit.edu>
Wed, 24 Apr 2013 22:29:46 -0700
changeset 129976 9b26c4651a1fea3a38692abbc20c97f01050a142
parent 129975 50842c3744ecdd68f307490425e0541df5e86eb2
child 129977 8a2536988191431002107005e92781caa80d8e78
push id24596
push userryanvm@gmail.com
push dateSat, 27 Apr 2013 01:20:57 +0000
treeherdermozilla-central@0e45f1b9521f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslumpy
bugs858677
milestone23.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
s/JS_TRUE/true/g; s/JS_FALSE/false/g. Following up on a request in bug 858677, r=lumpy
js/src/jsarray.cpp
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -229,23 +229,23 @@ AssertGreaterThanZero(uint32_t index)
 template<typename IndexType>
 static JSBool
 GetElement(JSContext *cx, HandleObject obj, IndexType index, JSBool *hole, MutableHandleValue vp)
 {
     AssertGreaterThanZero(index);
     if (obj->isNative() && index < obj->getDenseInitializedLength()) {
         vp.set(obj->getDenseElement(uint32_t(index)));
         if (!vp.isMagic(JS_ELEMENTS_HOLE)) {
-            *hole = JS_FALSE;
-            return JS_TRUE;
+            *hole = false;
+            return true;
         }
     }
     if (obj->isArguments()) {
         if (obj->asArguments().maybeGetElement(uint32_t(index), vp)) {
-            *hole = JS_FALSE;
+            *hole = false;
             return true;
         }
     }
 
     return DoGetElement(cx, obj, index, hole, vp);
 }
 
 static bool
@@ -2102,17 +2102,17 @@ array_unshift(JSContext *cx, unsigned ar
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedObject obj(cx, ToObject(cx, args.thisv()));
     if (!obj)
         return false;
 
     uint32_t length;
     if (!GetLengthProperty(cx, obj, &length))
-        return JS_FALSE;
+        return false;
 
     double newlen = length;
     if (args.length() > 0) {
         /* Slide up the array to make room for all args at the bottom. */
         if (length > 0) {
             bool optimized = false;
             do {
                 if (!obj->isArray())
@@ -2153,26 +2153,26 @@ array_unshift(JSContext *cx, unsigned ar
                             return false;
                     }
                 } while (last != 0);
             }
         }
 
         /* Copy from args to the bottom of the array. */
         if (!InitArrayElements(cx, obj, 0, args.length(), args.array(), UpdateTypes))
-            return JS_FALSE;
+            return false;
 
         newlen += args.length();
     }
     if (!SetLengthProperty(cx, obj, newlen))
-        return JS_FALSE;
+        return false;
 
     /* Follow Perl by returning the new array length. */
     args.rval().setNumber(newlen);
-    return JS_TRUE;
+    return true;
 }
 
 static inline void
 TryReuseArrayType(JSObject *obj, JSObject *nobj)
 {
     /*
      * Try to change the type of a newly created array nobj to the same type
      * as obj. This can only be performed if the original object is an array
@@ -2500,28 +2500,28 @@ js::array_concat(JSContext *cx, unsigned
 
     RootedObject nobj(cx);
     uint32_t length;
     if (aobj->isArray() && !aobj->isIndexed()) {
         length = aobj->getArrayLength();
         uint32_t initlen = aobj->getDenseInitializedLength();
         nobj = NewDenseCopiedArray(cx, initlen, aobj, 0);
         if (!nobj)
-            return JS_FALSE;
+            return false;
         TryReuseArrayType(aobj, nobj);
         JSObject::setArrayLength(cx, nobj, length);
         args.rval().setObject(*nobj);
         if (argc == 0)
-            return JS_TRUE;
+            return true;
         argc--;
         p++;
     } else {
         nobj = NewDenseEmptyArray(cx);
         if (!nobj)
-            return JS_FALSE;
+            return false;
         args.rval().setObject(*nobj);
         length = 0;
     }
 
     /* Loop over [0, argc] to concat args into nobj, expanding all Arrays. */
     for (unsigned i = 0; i <= argc; i++) {
         if (!JS_CHECK_OPERATION_LIMIT(cx))
             return false;
@@ -2566,17 +2566,17 @@ array_slice(JSContext *cx, unsigned argc
 
     CallArgs args = CallArgsFromVp(argc, vp);
 
     RootedObject obj(cx, ToObject(cx, args.thisv()));
     if (!obj)
         return false;
 
     if (!GetLengthProperty(cx, obj, &length))
-        return JS_FALSE;
+        return false;
     begin = 0;
     end = length;
 
     if (args.length() > 0) {
         double d;
         if (!ToInteger(cx, args[0], &d))
             return false;
         if (d < 0) {
@@ -2607,39 +2607,39 @@ array_slice(JSContext *cx, unsigned argc
 
     RootedObject nobj(cx);
 
     if (obj->isArray() && end <= obj->getDenseInitializedLength() &&
         !ObjectMayHaveExtraIndexedProperties(obj))
     {
         nobj = NewDenseCopiedArray(cx, end - begin, obj, begin);
         if (!nobj)
-            return JS_FALSE;
+            return false;
         TryReuseArrayType(obj, nobj);
         args.rval().setObject(*nobj);
-        return JS_TRUE;
+        return true;
     }
 
     nobj = NewDenseAllocatedArray(cx, end - begin);
     if (!nobj)
-        return JS_FALSE;
+        return false;
     TryReuseArrayType(obj, nobj);
 
     RootedValue value(cx);
     for (slot = begin; slot < end; slot++) {
         if (!JS_CHECK_OPERATION_LIMIT(cx) ||
             !GetElement(cx, obj, slot, &hole, &value)) {
-            return JS_FALSE;
+            return false;
         }
         if (!hole && !SetArrayElement(cx, nobj, slot - begin, value))
-            return JS_FALSE;
+            return false;
     }
 
     args.rval().setObject(*nobj);
-    return JS_TRUE;
+    return true;
 }
 
 /* ES5 15.4.4.20. */
 static JSBool
 array_filter(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
 
@@ -2783,17 +2783,17 @@ static const JSFunctionSpec array_static
 
 /* ES5 15.4.2 */
 JSBool
 js_Array(JSContext *cx, unsigned argc, Value *vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     RootedTypeObject type(cx, GetTypeCallerInitObject(cx, JSProto_Array));
     if (!type)
-        return JS_FALSE;
+        return false;
 
     if (args.length() != 1 || !args[0].isNumber()) {
         if (!InitArrayTypes(cx, type, args.array(), args.length()))
             return false;
         JSObject *obj = (args.length() == 0)
                         ? NewDenseEmptyArray(cx)
                         : NewDenseCopiedArray(cx, args.length(), args.array());
         if (!obj)
@@ -3055,17 +3055,17 @@ js_ArrayInfo(JSContext *cx, unsigned arg
     CallArgs args = CallArgsFromVp(argc, vp);
     JSObject *array;
 
     for (unsigned i = 0; i < args.length(); i++) {
         RootedValue arg(cx, args[i]);
 
         char *bytes = DecompileValueGenerator(cx, JSDVG_SEARCH_STACK, arg, NullPtr());
         if (!bytes)
-            return JS_FALSE;
+            return false;
         if (arg.isPrimitive() ||
             !(array = arg.toObjectOrNull())->isArray()) {
             fprintf(stderr, "%s: not array\n", bytes);
             js_free(bytes);
             continue;
         }
         fprintf(stderr, "%s: (len %u", bytes, array->getArrayLength());
         fprintf(stderr, ", capacity %u", array->getDenseCapacity());