Update some deprecated function calls

This commit is contained in:
Dan Stillman 2016-12-29 15:39:09 -05:00
parent 2beb2c514c
commit a076edc836
4 changed files with 11 additions and 12 deletions

View file

@ -274,7 +274,8 @@ Zotero.Sync.Data.Engine.prototype._startDownload = Zotero.Promise.coroutine(func
} }
if (newLibraryVersion) { if (newLibraryVersion) {
yield Zotero.Libraries.setVersion(this.libraryID, newLibraryVersion); this.library.libraryVersion = newLibraryVersion;
yield this.library.saveTx();
} }
return localChanges return localChanges
@ -1513,7 +1514,8 @@ Zotero.Sync.Data.Engine.prototype._fullSync = Zotero.Promise.coroutine(function*
break; break;
} }
yield Zotero.Libraries.setVersion(this.libraryID, lastLibraryVersion); this.library.libraryVersion = lastLibraryVersion;
yield this.library.saveTx();
Zotero.debug("Done with full sync for " + this.library.name); Zotero.debug("Done with full sync for " + this.library.name);

View file

@ -1453,7 +1453,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js");
caller.setLogger(Zotero.debug); caller.setLogger(Zotero.debug);
return function () { return function () {
var args = arguments; var args = arguments;
return caller.fcall(function () { return caller.start(function () {
return fn.apply(this, args); return fn.apply(this, args);
}.bind(this)); }.bind(this));
}; };

View file

@ -165,12 +165,6 @@ ConcurrentCaller.prototype.runAll = function () {
} }
ConcurrentCaller.prototype.fcall = function (func) {
this._log("fcall() is deprecated -- use start()");
return this.start(func);
}
/** /**
* Wait for all running tasks to complete * Wait for all running tasks to complete
* *

View file

@ -239,8 +239,10 @@ describe("Zotero.Sync.Data.FullTextEngine", function () {
// https://github.com/cjohansen/Sinon.JS/issues/607 // https://github.com/cjohansen/Sinon.JS/issues/607
var fixSinonBug = ";charset=utf-8"; var fixSinonBug = ";charset=utf-8";
var libraryID = Zotero.Libraries.userLibraryID; var library = Zotero.Libraries.userLibrary;
yield Zotero.Libraries.setVersion(libraryID, 5); var libraryID = library.id;
library.libraryVersion = 5;
yield library.saveTx();
({ engine, client, caller } = yield setup()); ({ engine, client, caller } = yield setup());
@ -347,7 +349,8 @@ describe("Zotero.Sync.Data.FullTextEngine", function () {
// Upload new content // Upload new content
// //
({ engine, client, caller } = yield setup()); ({ engine, client, caller } = yield setup());
yield Zotero.Libraries.setVersion(libraryID, libraryVersion); library.libraryVersion = libraryVersion;
yield library.saveTx();
var attachment3 = new Zotero.Item('attachment'); var attachment3 = new Zotero.Item('attachment');
attachment3.parentItemID = item.id; attachment3.parentItemID = item.id;