@@ -373,7 +373,7 @@ var $Sequence = Sequence;
373
373
return reversed . reduce . apply ( reversed , arguments ) ;
374
374
} ,
375
375
reverse : function ( ) {
376
- return reverseFactory ( this ) ;
376
+ return reverseFactory ( this , true ) ;
377
377
} ,
378
378
slice : function ( begin , end ) {
379
379
if ( wholeSlice ( begin , end , this . length ) ) {
@@ -652,6 +652,9 @@ var $IndexedSequence = IndexedSequence;
652
652
lastIndexOf : function ( searchValue ) {
653
653
return this . toKeyedSeq ( ) . reverse ( ) . indexOf ( searchValue ) ;
654
654
} ,
655
+ reverse : function ( ) {
656
+ return reverseFactory ( this , false ) ;
657
+ } ,
655
658
splice : function ( index , removeNum ) {
656
659
var numArgs = arguments . length ;
657
660
removeNum = Math . max ( removeNum | 0 , 0 ) ;
@@ -1028,7 +1031,7 @@ var KeyedIndexedSequence = function KeyedIndexedSequence(indexedSeq) {
1028
1031
} ,
1029
1032
reverse : function ( ) {
1030
1033
var $__0 = this ;
1031
- var reversedSequence = reverseFactory ( this ) ;
1034
+ var reversedSequence = reverseFactory ( this , true ) ;
1032
1035
reversedSequence . valueSeq = ( function ( ) {
1033
1036
return $__0 . _seq . reverse ( ) ;
1034
1037
} ) ;
@@ -1170,7 +1173,7 @@ function mapFactory(sequence, mapper, context) {
1170
1173
} ;
1171
1174
return mappedSequence ;
1172
1175
}
1173
- function reverseFactory ( sequence ) {
1176
+ function reverseFactory ( sequence , useKeys ) {
1174
1177
var reversedSequence = sequence . __makeSequence ( ) ;
1175
1178
reversedSequence . length = sequence . length ;
1176
1179
reversedSequence . reverse = ( function ( ) {
@@ -1184,7 +1187,7 @@ function reverseFactory(sequence) {
1184
1187
return flipSequence ;
1185
1188
} ;
1186
1189
reversedSequence . get = ( function ( key , notSetValue ) {
1187
- return sequence . get ( key , notSetValue ) ;
1190
+ return sequence . get ( useKeys ? key : - 1 - key , notSetValue ) ;
1188
1191
} ) ;
1189
1192
reversedSequence . has = ( function ( key ) {
1190
1193
return sequence . has ( key ) ;
0 commit comments