@@ -3424,14 +3424,36 @@ var Cursor = function Cursor(rootData, keyPath, onChange, length) {
3424
3424
} ) ) ;
3425
3425
}
3426
3426
} , { } , Sequence ) ;
3427
- Cursor . prototype [ DELETE ] = Cursor . prototype . remove ;
3428
- Cursor . prototype . getIn = Cursor . prototype . get ;
3427
+ var CursorPrototype = Cursor . prototype ;
3428
+ CursorPrototype [ DELETE ] = CursorPrototype . remove ;
3429
+ CursorPrototype . getIn = CursorPrototype . get ;
3430
+ var IndexedCursor = function IndexedCursor ( rootData , keyPath , onChange , length ) {
3431
+ this . length = length ;
3432
+ this . _rootData = rootData ;
3433
+ this . _keyPath = keyPath ;
3434
+ this . _onChange = onChange ;
3435
+ } ;
3436
+ ( $traceurRuntime . createClass ) ( IndexedCursor , { } , { } , IndexedSequence ) ;
3437
+ var IndexedCursorPrototype = IndexedCursor . prototype ;
3438
+ IndexedCursorPrototype . equals = CursorPrototype . equals ;
3439
+ IndexedCursorPrototype . deref = CursorPrototype . deref ;
3440
+ IndexedCursorPrototype . get = CursorPrototype . get ;
3441
+ IndexedCursorPrototype . getIn = CursorPrototype . getIn ;
3442
+ IndexedCursorPrototype . set = CursorPrototype . set ;
3443
+ IndexedCursorPrototype [ DELETE ] = IndexedCursorPrototype . remove = CursorPrototype . remove ;
3444
+ IndexedCursorPrototype . clear = CursorPrototype . clear ;
3445
+ IndexedCursorPrototype . update = CursorPrototype . update ;
3446
+ IndexedCursorPrototype . withMutations = CursorPrototype . withMutations ;
3447
+ IndexedCursorPrototype . cursor = CursorPrototype . cursor ;
3448
+ IndexedCursorPrototype . __iterate = CursorPrototype . __iterate ;
3449
+ IndexedCursorPrototype . __iterator = CursorPrototype . __iterator ;
3429
3450
function makeCursor ( rootData , keyPath , onChange , value ) {
3430
3451
if ( arguments . length < 4 ) {
3431
3452
value = rootData . getIn ( keyPath ) ;
3432
3453
}
3433
3454
var length = value instanceof Sequence ? value . length : null ;
3434
- return new Cursor ( rootData , keyPath , onChange , length ) ;
3455
+ var CursorClass = value instanceof IndexedSequence ? IndexedCursor : Cursor ;
3456
+ return new CursorClass ( rootData , keyPath , onChange , length ) ;
3435
3457
}
3436
3458
function wrappedValue ( cursor , key , value ) {
3437
3459
return value instanceof Sequence ? subCursor ( cursor , key , value ) : value ;
0 commit comments