Use consistent style for promises
This commit is contained in:
parent
93411a3dac
commit
b13b46c641
1 changed files with 4 additions and 2 deletions
|
@ -152,9 +152,11 @@ Zotero.Translators = new function() {
|
|||
*/
|
||||
this.loadFromDisk = function(file) {
|
||||
const infoRe = /^\s*{[\S\s]*?}\s*?[\r\n]/;
|
||||
return Zotero.File.getContentsAsync(file).then(function(source) {
|
||||
return Zotero.File.getContentsAsync(file)
|
||||
.then(function(source) {
|
||||
return Zotero.Translators.load(file, infoRe.exec(source)[0], source);
|
||||
}).fail(function() {
|
||||
})
|
||||
.fail(function() {
|
||||
throw "Invalid or missing translator metadata JSON object in " + file.leafName;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue