mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
CollectionIterator_next: async + async/yield -> sync.
This commit is contained in:
parent
3a4f2ca0ee
commit
e7a503025a
@ -148,21 +148,17 @@ CollectionIterator.prototype = {
|
||||
|
||||
get count() { return this._coll.data.length; },
|
||||
|
||||
next: function CollIter_next(onComplete) {
|
||||
let fn = function CollIter__next() {
|
||||
let self = yield;
|
||||
next: function CollectionIterator_next() {
|
||||
if (this._idx >= this.count)
|
||||
return null;
|
||||
|
||||
if (this._idx >= this.count)
|
||||
return;
|
||||
let item = this._coll.data[this._idx++];
|
||||
let record = new this._coll._recordObj();
|
||||
record.deserialize(JSON.stringify(item)); // FIXME: inefficient
|
||||
record.baseUri = this._coll.uri;
|
||||
record.id = record.data.id;
|
||||
let item = this._coll.data[this._idx++];
|
||||
let record = new this._coll._recordObj();
|
||||
record.deserialize(JSON.stringify(item)); // FIXME: inefficient
|
||||
record.baseUri = this._coll.uri;
|
||||
record.id = record.data.id;
|
||||
|
||||
self.done(record);
|
||||
};
|
||||
fn.async(this, onComplete);
|
||||
return record;
|
||||
},
|
||||
|
||||
reset: function CollIter_reset() {
|
||||
|
@ -347,7 +347,7 @@ SyncEngine.prototype = {
|
||||
let count = {applied: 0, reconciled: 0};
|
||||
this._lastSyncTmp = 0;
|
||||
|
||||
while ((item = yield newitems.iter.next(self.cb))) {
|
||||
while ((item = newitems.iter.next())) {
|
||||
this._lowMemCheck();
|
||||
try {
|
||||
item.decrypt(ID.get('WeaveCryptoID').password);
|
||||
|
Loading…
Reference in New Issue
Block a user