+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
{
JSLock lock;
- ValueImp *result = Undefined();
+ ValueImp *result = jsUndefined();
if (ptr)
{
bool handled = false;
CFTypeID typeID = CFGetTypeID(cfType);
if (typeID == CFStringGetTypeID())
{
- result = String(CFStringToUString((CFStringRef)cfType));
+ result = jsString(CFStringToUString((CFStringRef)cfType));
handled = true;
}
else if (typeID == CFNumberGetTypeID())
double num;
if (CFNumberGetValue((CFNumberRef)cfType, kCFNumberDoubleType, &num))
{
- result = Number(num);
+ result = jsNumber(num);
handled = true;
}
}
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())
}
else if (typeID == CFNullGetTypeID())
{
- result = Null();
+ result = jsNull();
handled = true;
}
}
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();
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);
}
}