Refactor the IL10n implementations to utilize async methods rather than manually returning Promises

This changes the methods signatures of `GenericL10n`, `MozL10n`, and `NullL10n`.
This commit is contained in:
Jonas Jenwald 2018-07-30 16:28:39 +02:00
parent af89ec271d
commit b0fa02e845
4 changed files with 30 additions and 37 deletions

View file

@ -145,21 +145,20 @@ class MozL10n {
this.mozL10n = mozL10n;
}
getLanguage() {
return Promise.resolve(this.mozL10n.getLanguage());
async getLanguage() {
return this.mozL10n.getLanguage();
}
getDirection() {
return Promise.resolve(this.mozL10n.getDirection());
async getDirection() {
return this.mozL10n.getDirection();
}
get(property, args, fallback) {
return Promise.resolve(this.mozL10n.get(property, args, fallback));
async get(property, args, fallback) {
return this.mozL10n.get(property, args, fallback);
}
translate(element) {
async translate(element) {
this.mozL10n.translate(element);
return Promise.resolve();
}
}