Address review comments from Waldo (bug 672829 comment 26).
authorJason Orendorff <jorendorff@mozilla.com>
Thu, 21 Jul 2011 17:38:05 -0500
changeset 75225 46a7638aeb4d9132dc416bda95605347f0070857
parent 75224 501052c6263ba6d4b020dbd205df08a41251b9c0
child 75226 8998a25f3887f8038426aaa4a050368d75dd499b
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs672829
milestone8.0a1
Address review comments from Waldo (bug 672829 comment 26).
js/src/jsobj.cpp
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -868,26 +868,32 @@ NonNullObject(JSContext *cx, const Value
         return NULL;
     }
     return &v.toObject();
 }
 
 const char *
 InformalValueTypeName(const Value &v)
 {
-    return v.isObject() ? v.toObject().getClass()->name :
-           v.isString() ? "string" :
-           v.isNumber() ? "number" :
-           v.isBoolean() ? "boolean" :
-           v.isNull() ? "null" :
-           v.isUndefined() ? "undefined" :
-           "value";
-}
-
-}
+    if (v.isObject())
+        return v.toObject().getClass()->name;
+    if (v.isString())
+        return "string";
+    if (v.isNumber())
+        return "number";
+    if (v.isBoolean())
+        return "boolean";
+    if (v.isNull())
+        return "null";
+    if (v.isUndefined())
+        return "undefined";
+    return "value";
+}
+
+} /* namespace js */
 
 /* ES5 15.2.4.2.  Note steps 1 and 2 are errata. */
 static JSBool
 obj_toString(JSContext *cx, uintN argc, Value *vp)
 {
     Value &thisv = vp[1];
 
     /* Step 1. */