@@ -131,7 +131,7 @@ module.exports = CoreObject.extend({
131
131
current : headObject ( client , { Bucket : bucket , Key : indexKey } ) ,
132
132
} )
133
133
. then ( function ( data ) {
134
- return data . revisions . All . sort ( function ( a , b ) {
134
+ return data . revisions . sort ( function ( a , b ) {
135
135
return new Date ( b . LastModified ) - new Date ( a . LastModified ) ;
136
136
} ) . map ( function ( d ) {
137
137
var revision = d . Key . substr ( revisionPrefix . length ) ;
@@ -146,24 +146,21 @@ module.exports = CoreObject.extend({
146
146
var listObjects = RSVP . denodeify ( client . listObjects . bind ( client ) ) ;
147
147
var allRevisions = [ ] ;
148
148
149
- return new Promise ( function ( resolve , reject ) {
150
- function listObjectRecursively ( options ) {
151
- listObjects ( options ) . then ( function ( response ) {
152
- [ ] . push . apply ( allRevisions , response . Contents ) ;
153
-
154
- if ( response . IsTruncated ) {
155
- var nextMarker = response . NextMarker || response . Contents [ response . Contents . length - 1 ] . Key ;
156
- options . Marker = nextMarker ;
157
- listObjectRecursively ( options ) ;
158
- } else {
159
- response . All = allRevisions ;
160
- resolve ( response ) ;
161
- }
162
- } ) . catch ( reject ) ;
163
- }
149
+ function listObjectRecursively ( options ) {
150
+ return listObjects ( options ) . then ( function ( response ) {
151
+ [ ] . push . apply ( allRevisions , response . Contents ) ;
164
152
165
- listObjectRecursively ( options ) ;
166
- } ) ;
153
+ if ( response . IsTruncated ) {
154
+ var nextMarker = response . Contents [ response . Contents . length - 1 ] . Key ;
155
+ options . Marker = nextMarker ;
156
+ return listObjectRecursively ( options ) ;
157
+ } else {
158
+ return allRevisions ;
159
+ }
160
+ } ) ;
161
+ }
162
+
163
+ return listObjectRecursively ( options ) ;
167
164
168
165
}
169
166
} ) ;
0 commit comments