Changeset 15468 in webkit for trunk/JavaScriptCore/API/testapi.c
- Timestamp:
- Jul 16, 2006, 2:06:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/testapi.c
r15465 r15468 170 170 } 171 171 172 static void MyObject_ addPropertiesToList(JSObjectRef object, JSPropertyListRef propertyList)172 static void MyObject_getPropertyNames(JSContextRef context, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames) 173 173 { 174 174 UNUSED_PARAM(context); … … 177 177 178 178 propertyName = JSStringCreateWithUTF8CString("alwaysOne"); 179 JSProperty ListAdd(propertyList, object, propertyName);179 JSPropertyNameAccumulatorAddName(propertyNames, propertyName); 180 180 JSStringRelease(propertyName); 181 181 182 182 propertyName = JSStringCreateWithUTF8CString("myPropertyName"); 183 JSProperty ListAdd(propertyList, object, propertyName);183 JSPropertyNameAccumulatorAddName(propertyNames, propertyName); 184 184 JSStringRelease(propertyName); 185 185 } … … 258 258 MyObject_setProperty, 259 259 MyObject_deleteProperty, 260 MyObject_ addPropertiesToList,260 MyObject_getPropertyNames, 261 261 MyObject_callAsFunction, 262 262 MyObject_callAsConstructor, … … 589 589 JSObjectSetProperty(context, o, jsOneIString, JSValueMakeNumber(1), kJSPropertyAttributeNone, NULL); 590 590 JSObjectSetProperty(context, o, jsCFIString, JSValueMakeNumber(1), kJSPropertyAttributeDontEnum, NULL); 591 JSPropertyEnumeratorRef enumerator = JSObjectCreatePropertyEnumerator(o); 592 int count = 0; 593 while (JSPropertyEnumeratorGetNextName(enumerator)) 594 ++count; 595 JSPropertyEnumeratorRelease(enumerator); 591 JSPropertyNameArrayRef nameArray = JSObjectCopyPropertyNames(context, o); 592 size_t expectedCount = JSPropertyNameArrayGetCount(nameArray); 593 size_t count; 594 for (count = 0; count < expectedCount; ++count) 595 JSPropertyNameArrayGetNameAtIndex(nameArray, count); 596 JSPropertyNameArrayRelease(nameArray); 596 597 assert(count == 1); // jsCFString should not be enumerated 597 598
Note:
See TracChangeset
for help on using the changeset viewer.