CFArrayRef JSObjectCopyPropertyNames(JSObjectRef ref) { CFArrayRef result = 0; JSUserObject* ptr = (JSUserObject*)ref; if (ptr && (ptr->GetTypeID() == kJSObjectTypeID)) { result = ptr->CopyPropertyNames(); } return result; }
void UserObjectImp::getPropertyNames(ExecState *exec, PropertyNameArray& propertyNames) { JSUserObject* ptr = GetJSUserObject(); if (ptr) { CFArrayRef cfPropertyNames = ptr->CopyPropertyNames(); if (cfPropertyNames) { CFIndex count = CFArrayGetCount(cfPropertyNames); CFIndex i; for (i = 0; i < count; i++) { CFStringRef propertyName = (CFStringRef)CFArrayGetValueAtIndex(cfPropertyNames, i); propertyNames.add(CFStringToIdentifier(propertyName)); } CFRelease(cfPropertyNames); } } JSObject::getPropertyNames(exec, propertyNames); }