Reviewed by Maciej.
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Dec 2005 00:35:59 +0000 (00:35 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 11 Dec 2005 00:35:59 +0000 (00:35 +0000)
        - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()

        Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().

        * JSUtils.cpp:
        (JSObjectKJSValue):
        * UserObjectImp.cpp:
        (UserObjectImp::callAsFunction):
        (UserObjectImp::toPrimitive):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12218 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptGlue/ChangeLog
JavaScriptGlue/JSUtils.cpp
JavaScriptGlue/UserObjectImp.cpp

index f01a51388f7f41eba19bb557ae77a4d536335f67..c6d2908a89669ae2ff1e9cb14e68699687c762c2 100644 (file)
@@ -1,3 +1,17 @@
+2005-12-10  Darin Adler  <darin@apple.com>
+
+        Reviewed by Maciej.
+
+        - eliminated the old Undefined(), Null(), Boolean(), Number(), and String()
+
+        Code now uses jsUndefined(), jsNull(), jsBoolean(), jsNumber(), and jsString().
+
+        * JSUtils.cpp:
+        (JSObjectKJSValue):
+        * UserObjectImp.cpp:
+        (UserObjectImp::callAsFunction):
+        (UserObjectImp::toPrimitive):
+
 2005-12-05  Maciej Stachowiak  <mjs@apple.com>
 
         - added new forwarding headers
index 637fa8091e4741e880bc068a08df51e841dee6d7..6f75191ea7ada0ebc6f65fed9ec613856a35e049 100644 (file)
@@ -106,7 +106,7 @@ ValueImp *JSObjectKJSValue(JSUserObject* ptr)
 {
     JSLock lock;
 
-    ValueImp *result = Undefined();
+    ValueImp *result = jsUndefined();
     if (ptr)
     {
         bool handled = false;
@@ -132,7 +132,7 @@ ValueImp *JSObjectKJSValue(JSUserObject* ptr)
                     CFTypeID typeID = CFGetTypeID(cfType);
                     if (typeID == CFStringGetTypeID())
                     {
-                        result = String(CFStringToUString((CFStringRef)cfType));
+                        result = jsString(CFStringToUString((CFStringRef)cfType));
                         handled = true;
                     }
                     else if (typeID == CFNumberGetTypeID())
@@ -142,7 +142,7 @@ ValueImp *JSObjectKJSValue(JSUserObject* ptr)
                             double num;
                             if (CFNumberGetValue((CFNumberRef)cfType, kCFNumberDoubleType, &num))
                             {
-                                result = Number(num);
+                                result = jsNumber(num);
                                 handled = true;
                             }
                         }
@@ -151,14 +151,14 @@ ValueImp *JSObjectKJSValue(JSUserObject* ptr)
                             long num;
                             if (CFNumberGetValue((CFNumberRef)cfType, kCFNumberLongType, &num))
                             {
-                                result = Number(num);
+                                result = jsNumber(num);
                                 handled = true;
                             }
                         }
                     }
                     else if (typeID == CFBooleanGetTypeID())
                     {
-                        result = KJS::Boolean(CFBooleanGetValue((CFBooleanRef)cfType));
+                        result = jsBoolean(CFBooleanGetValue((CFBooleanRef)cfType));
                         handled = true;
                     }
                     else if (typeID == CFDateGetTypeID())
@@ -166,7 +166,7 @@ ValueImp *JSObjectKJSValue(JSUserObject* ptr)
                     }
                     else if (typeID == CFNullGetTypeID())
                     {
-                        result = Null();
+                        result = jsNull();
                         handled = true;
                     }
                 }
index 52d5e56430071cc29f123dca1b48cee2825b9f16..b96905025484d4dbcbaeeaa3caecfceff716bb5b 100644 (file)
@@ -57,7 +57,7 @@ bool UserObjectImp::implementsCall() const
 
 ValueImp *UserObjectImp::callAsFunction(ExecState *exec, ObjectImp *thisObj, const List &args)
 {
-    ValueImp *result = Undefined();
+    ValueImp *result = jsUndefined();
     JSUserObject* jsThisObj = KJSValueToJSObject(thisObj, exec);
     if (jsThisObj) {
         CFIndex argCount = args.size();
@@ -172,30 +172,30 @@ JSUserObject* UserObjectImp::GetJSUserObject() const
 
 ValueImp *UserObjectImp::toPrimitive(ExecState *exec, Type preferredType) const
 {
-    ValueImp *result = Undefined();
+    ValueImp *result = jsUndefined();
     JSUserObject* jsObjPtr = KJSValueToJSObject(toObject(exec), exec);
     CFTypeRef cfValue = jsObjPtr ? jsObjPtr->CopyCFValue() : 0;
     if (cfValue) {
         CFTypeID cfType = CFGetTypeID(cfValue);  // toPrimitive
         if (cfValue == GetCFNull()) {
-            result = Null();
+            result = jsNull();
         }
         else if (cfType == CFBooleanGetTypeID()) {
             if (cfValue == kCFBooleanTrue) {
-                result = KJS::Boolean(true);
+                result = jsBoolean(true);
             } else {
-                result = KJS::Boolean(false);
+                result = jsBoolean(false);
             }
         } else if (cfType == CFStringGetTypeID()) {
-            result = KJS::String(CFStringToUString((CFStringRef)cfValue));
+            result = jsString(CFStringToUString((CFStringRef)cfValue));
         } else if (cfType == CFNumberGetTypeID()) {
             double d = 0.0;
             CFNumberGetValue((CFNumberRef)cfValue, kCFNumberDoubleType, &d);
-            result = KJS::Number(d);
+            result = jsNumber(d);
         } else if (cfType == CFURLGetTypeID()) {
             CFURLRef absURL = CFURLCopyAbsoluteURL((CFURLRef)cfValue);
             if (absURL) {
-                result = KJS::String(CFStringToUString(CFURLGetString(absURL)));
+                result = jsString(CFStringToUString(CFURLGetString(absURL)));
                 ReleaseCFType(absURL);
             }
         }