Bug 1440320 - Convert Task.jsm to async/await in devtools/shared. r=jryans

MozReview-Commit-ID: IK8BzlYuOWm
This commit is contained in:
Alexandre Poirot
2018-02-22 00:49:06 -08:00
parent 2d2e6dbc3e
commit c693997506
71 changed files with 525 additions and 546 deletions

View File

@@ -19,7 +19,6 @@ loader.lazyRequireGetter(this, "CSS_ANGLEUNIT",
const promise = require("promise");
const {getCSSLexer} = require("devtools/shared/css/lexer");
const {Task} = require("devtools/shared/task");
const SELECTOR_ATTRIBUTE = exports.SELECTOR_ATTRIBUTE = 1;
const SELECTOR_ELEMENT = exports.SELECTOR_ELEMENT = 2;
@@ -902,7 +901,7 @@ RuleRewriter.prototype = {
* @return {Promise} a promise that is resolved when the edit has
* completed
*/
internalCreateProperty: Task.async(function* (index, name, value, priority, enabled) {
async internalCreateProperty(index, name, value, priority, enabled) {
this.completeInitialization(index);
let newIndentation = "";
if (this.hasNewLine) {
@@ -912,7 +911,7 @@ RuleRewriter.prototype = {
} else if (this.defaultIndentation) {
newIndentation = this.defaultIndentation;
} else {
newIndentation = yield this.getDefaultIndentation();
newIndentation = await this.getDefaultIndentation();
}
}
@@ -954,7 +953,7 @@ RuleRewriter.prototype = {
// index.
this.completeCopying(this.decl.offsets[0]);
}
}),
},
/**
* Create a new declaration.