|
|
|
NOTE 2 A For-In Iterator is an object that represents a specific iteration over some specific object. For-In Iterator objects are . The abstract operation CreateForInIterator takes argument object . It is used to create a For-In Iterator object which iterates over the own and inherited enumerable string properties of object in a specific order. It performs the following steps when called: 1. : object ) is Object. 2. Let iterator be ! , « [[Object]], [[ObjectWasVisited]], [[VisitedKeys]], [[RemainingKeys]] »). 3. Set iterator .[[Object]] to object . 4. Set iterator .[[ObjectWasVisited]] to false . 5. Set iterator .[[VisitedKeys]] to a new empty . 6. Set iterator .[[RemainingKeys]] to a new empty . 7. Return iterator . The %ForInIteratorPrototype% object: has properties that are inherited by all For-In Iterator Objects. . has a [[Prototype]] internal slot whose value is . is never directly accessible to ECMAScript code. 1. Let O be the this value. 2. : O ) is Object. 3. : O has all of the internal slots of a For-In Iterator Instance ( ). 4. Let object be O .[[Object]]. 5. Let visited be O .[[VisitedKeys]]. 6. Let remaining be O .[[RemainingKeys]]. 7. Repeat, a. If O .[[ObjectWasVisited]] is false , then i. Let keys be ? object .[[OwnPropertyKeys]](). ii. For each element key of keys , do 1. If ( key ) is String, then a. Append key to remaining . The list of exotic objects for which implementations are not required to match was chosen because implementations historically differed in behaviour for those cases, and 14.7.5.10 For-In Iterator Objects 14.7.5.10.1 CreateForInIterator ( object ) 14.7.5.10.2 The %ForInIteratorPrototype% Object 14.7.5.10.2.1 %ForInIteratorPrototype%.next ( ) 378 |