File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -255,11 +255,8 @@ - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state
255255 // or until we've provided as many items as the stack based buffer will hold.
256256 while ((enumState->state < propCount) && (count < len))
257257 {
258- // For this sample, we generate the contents on the fly.
259- // A real implementation would likely just be copying objects from internal storage.
260- enumState->itemsPtr [count] = [enumState->propNames objectAtIndex: count];
258+ enumState->itemsPtr [count++] = [enumState->propNames objectAtIndex: enumState->state];
261259 enumState->state ++;
262- count++;
263260 }
264261 }
265262 else
Original file line number Diff line number Diff line change 282282 0867D690FE84028FC02AAC07 /* Project object */ = {
283283 isa = PBXProject;
284284 attributes = {
285- LastUpgradeCheck = 0430 ;
285+ LastUpgradeCheck = 0450 ;
286286 };
287287 buildConfigurationList = 1DEB922208733DC00010E9CD /* Build configuration list for PBXProject "GAJavaScript" */;
288288 compatibilityVersion = "Xcode 3.2";
Original file line number Diff line number Diff line change @@ -184,6 +184,19 @@ - (void)testFastEnumeration
184184 }
185185
186186 GHAssertTrue (foundHostName, nil );
187+
188+ // Test that the enumeration does not return duplicate property names. It was doing that for objects with
189+ // more than 16 properties.
190+ //
191+ jsObject = [_engine scriptObjectWithReference: @" window" ];
192+ NSMutableArray *keyNames = [NSMutableArray array ];
193+
194+ for (id key in jsObject)
195+ {
196+ GHAssertFalse ([keyNames containsObject: key], @" Enumeration is returning duplicates!" );
197+
198+ [keyNames addObject: key];
199+ }
187200}
188201
189202- (void )testCallFunction
You can’t perform that action at this time.
0 commit comments