--- a/accessible/tests/browser/e10s/browser_treeupdate_list.js
+++ b/accessible/tests/browser/e10s/browser_treeupdate_list.js
@@ -5,17 +5,17 @@
'use strict';
/* import-globals-from ../../mochitest/role.js */
loadScripts({ name: 'role.js', dir: MOCHITESTS_DIR });
async function setDisplayAndWaitForReorder(browser, value) {
let onReorder = waitForEvent(EVENT_REORDER, 'ul');
await invokeSetStyle(browser, 'li', 'display', value);
- return await onReorder;
+ return onReorder;
}
addAccessibleTask(`
<ul id="ul">
<li id="li">item1</li>
</ul>`, async function(browser, accDoc) {
let li = findAccessibleChildByID(accDoc, 'li');
let bullet = li.firstChild;
--- a/browser/base/content/test/alerts/browser_notification_tab_switching.js
+++ b/browser/base/content/test/alerts/browser_notification_tab_switching.js
@@ -20,17 +20,17 @@ add_task(async function test_notificatio
}, async function dummyTabTask(aBrowser) {
// Put new tab in background so it is obvious when it is re-focused.
await BrowserTestUtils.switchTab(gBrowser, originalTab);
isnot(gBrowser.selectedBrowser, aBrowser, "Notification page loaded as a background tab");
// First, show a notification that will be have the tab-switching prevented.
function promiseNotificationEvent(evt) {
return ContentTask.spawn(aBrowser, evt, async function(contentEvt) {
- return await new Promise(resolve => {
+ return new Promise(resolve => {
let contentNotification = content.wrappedJSObject._notification;
contentNotification.addEventListener(contentEvt, function(event) {
resolve({ defaultPrevented: event.defaultPrevented });
}, {once: true});
});
});
}
await openNotification(aBrowser, "showNotification1");
--- a/browser/base/content/test/general/browser_aboutCertError.js
+++ b/browser/base/content/test/general/browser_aboutCertError.js
@@ -129,17 +129,17 @@ add_task(async function checkWrongSystem
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, BAD_CERT);
browser = gBrowser.selectedBrowser;
certErrorLoaded = BrowserTestUtils.waitForErrorPage(browser);
}, false);
info("Loading and waiting for the cert error");
await certErrorLoaded;
- return await ContentTask.spawn(browser, null, async function() {
+ return ContentTask.spawn(browser, null, async function() {
let doc = content.document;
let div = doc.getElementById("wrongSystemTimePanel");
let systemDateDiv = doc.getElementById("wrongSystemTime_systemDate");
let actualDateDiv = doc.getElementById("wrongSystemTime_actualDate");
let learnMoreLink = doc.getElementById("learnMoreLink");
return {
divDisplay: content.getComputedStyle(div).display,
--- a/browser/base/content/test/static/browser_misused_characters_in_strings.js
+++ b/browser/base/content/test/static/browser_misused_characters_in_strings.js
@@ -147,20 +147,20 @@ function testForErrors(filepath, key, st
testForError(filepath, key, str, /"/, "double-quote", "Double-quoted strings should use Unicode \u201cfoo\u201d instead of \"foo\".");
testForError(filepath, key, str, /\.\.\./, "ellipsis", "Strings with an ellipsis should use the Unicode \u2026 character instead of three periods.");
}
async function getAllTheFiles(extension) {
let appDirGreD = Services.dirsvc.get("GreD", Ci.nsIFile);
let appDirXCurProcD = Services.dirsvc.get("XCurProcD", Ci.nsIFile);
if (appDirGreD.contains(appDirXCurProcD)) {
- return await generateURIsFromDirTree(appDirGreD, [extension]);
+ return generateURIsFromDirTree(appDirGreD, [extension]);
}
if (appDirXCurProcD.contains(appDirGreD)) {
- return await generateURIsFromDirTree(appDirXCurProcD, [extension]);
+ return generateURIsFromDirTree(appDirXCurProcD, [extension]);
}
let urisGreD = await generateURIsFromDirTree(appDirGreD, [extension]);
let urisXCurProcD = await generateURIsFromDirTree(appDirXCurProcD, [extension]);
return Array.from(new Set(urisGreD.concat(appDirXCurProcD)));
}
add_task(async function checkAllTheProperties() {
// This asynchronously produces a list of URLs (sadly, mostly sync on our
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_popup_resize.js
@@ -1,16 +1,16 @@
/* -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- */
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
-async function openPanel(extension, win = window, awaitLoad = false) {
+function openPanel(extension, win = window, awaitLoad = false) {
clickBrowserAction(extension, win);
- return await awaitExtensionPanel(extension, win, awaitLoad);
+ return awaitExtensionPanel(extension, win, awaitLoad);
}
add_task(async function testBrowserActionPopupResize() {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
"browser_action": {
"default_popup": "popup.html",
"browser_style": true,
--- a/browser/components/extensions/test/browser/browser_ext_contextMenus_onclick.js
+++ b/browser/components/extensions/test/browser/browser_ext_contextMenus_onclick.js
@@ -102,19 +102,19 @@ add_task(async function() {
let items = extensionMenuRoot.getElementsByAttribute("label", "tifier");
is(items.length, 1, "Expected one context menu item");
await closeExtensionContextMenu(items[0]);
// One of them is "tab", the other is "background".
info(`onClicked from: ${await extension.awaitMessage("onClicked-fired")}`);
info(`onClicked from: ${await extension.awaitMessage("onClicked-fired")}`);
}
- async function getCounts(page) {
+ function getCounts(page) {
extension.sendMessage(page, "get-click-counts");
- return await extension.awaitMessage("click-counts");
+ return extension.awaitMessage("click-counts");
}
async function resetCounts() {
extension.sendMessage("tab", "clear-click-counts");
extension.sendMessage("background", "clear-click-counts");
await extension.awaitMessage("next");
await extension.awaitMessage("next");
}
--- a/browser/components/originattributes/test/browser/browser_blobURLIsolation.js
+++ b/browser/components/originattributes/test/browser/browser_blobURLIsolation.js
@@ -45,33 +45,33 @@ function page_deblobify(browser, blobURL
});
}
let blob = await blobURLtoBlob(contentBlobURL);
if (blob == "xhr error") {
return "xhr error";
}
- return await blobToString(blob);
+ return blobToString(blob);
});
}
function workerIO(browser, scriptFile, message) {
- return ContentTask.spawn(browser, {scriptFile, message}, async function(args) {
+ return ContentTask.spawn(browser, {scriptFile, message}, function(args) {
let worker = new content.Worker(args.scriptFile);
let promise = new content.Promise(function(resolve) {
let listenFunction = function(event) {
worker.removeEventListener("message", listenFunction);
worker.terminate();
resolve(event.data);
};
worker.addEventListener("message", listenFunction);
});
worker.postMessage(args.message);
- return await promise;
+ return promise;
});
}
let worker_blobify = (browser, input) => workerIO(browser, SCRIPT_WORKER_BLOBIFY, input);
let worker_deblobify = (browser, blobURL) => workerIO(browser, SCRIPT_WORKER_DEBLOBIFY, blobURL);
function doTest(blobify, deblobify) {
let blobURL = null;
--- a/browser/components/originattributes/test/browser/browser_cookieIsolation.js
+++ b/browser/components/originattributes/test/browser/browser_cookieIsolation.js
@@ -5,19 +5,19 @@
const TEST_PAGE = "http://mochi.test:8888/browser/browser/components/" +
"originattributes/test/browser/file_firstPartyBasic.html";
// Use a random key so we don't access it in later tests.
const key = "key" + Math.random().toString();
const re = new RegExp(key + "=([0-9\.]+)");
// Define the testing function
-async function doTest(aBrowser) {
- return await ContentTask.spawn(aBrowser, [key, re],
- function([contentKey, contentRe]) {
+function doTest(aBrowser) {
+ return ContentTask.spawn(aBrowser, [key, re],
+ function([contentKey, contentRe]) {
let result = contentRe.exec(content.document.cookie);
if (result) {
return result[1];
}
// No value is found, so we create one.
let value = Math.random().toString();
content.document.cookie = contentKey + "=" + value;
return value;
--- a/browser/components/originattributes/test/browser/browser_localStorageIsolation.js
+++ b/browser/components/originattributes/test/browser/browser_localStorageIsolation.js
@@ -4,18 +4,18 @@
const TEST_PAGE = "http://mochi.test:8888/browser/browser/components/" +
"originattributes/test/browser/file_firstPartyBasic.html";
// Use a random key so we don't access it in later tests.
const key = Math.random().toString();
// Define the testing function
-async function doTest(aBrowser) {
- return await ContentTask.spawn(aBrowser, key, function(contentKey) {
+function doTest(aBrowser) {
+ return ContentTask.spawn(aBrowser, key, function(contentKey) {
let value = content.localStorage.getItem(contentKey);
if (value === null) {
// No value is found, so we create one.
value = Math.random().toString();
content.localStorage.setItem(contentKey, value);
}
return value;
});
--- a/browser/components/places/PlacesUIUtils.jsm
+++ b/browser/components/places/PlacesUIUtils.jsm
@@ -1539,17 +1539,17 @@ this.PlacesUIUtils = {
* Bookmarks.fetch for the given guid/info object.
*
* @see promiseNodeLikeFromFetchInfo above and Bookmarks.fetch in Bookmarks.jsm.
*/
async fetchNodeLike(aGuidOrInfo) {
let info = await PlacesUtils.bookmarks.fetch(aGuidOrInfo);
if (!info)
return null;
- return (await this.promiseNodeLikeFromFetchInfo(info));
+ return this.promiseNodeLikeFromFetchInfo(info);
}
};
PlacesUIUtils.PLACES_FLAVORS = [PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER,
PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR,
PlacesUtils.TYPE_X_MOZ_PLACE];
--- a/browser/components/preferences/in-content-new/applications.js
+++ b/browser/components/preferences/in-content-new/applications.js
@@ -2082,20 +2082,20 @@ var gApplicationsPane = {
* Converts an integer into the corresponding folder.
*
* @param aIndex
* an integer
* @returns the Desktop folder if aIndex == 0,
* the Downloads folder if aIndex == 1,
* the folder stored in browser.download.dir
*/
- async _indexToFolder(aIndex) {
+ _indexToFolder(aIndex) {
switch (aIndex) {
case 0:
- return await this._getDownloadsFolder("Desktop");
+ return this._getDownloadsFolder("Desktop");
case 1:
- return await this._getDownloadsFolder("Downloads");
+ return this._getDownloadsFolder("Downloads");
}
var currentDirPref = document.getElementById("browser.download.dir");
return currentDirPref.value;
}
};
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -648,22 +648,22 @@ var gMainPane = {
* Converts an integer into the corresponding folder.
*
* @param aIndex
* an integer
* @returns the Desktop folder if aIndex == 0,
* the Downloads folder if aIndex == 1,
* the folder stored in browser.download.dir
*/
- async _indexToFolder(aIndex) {
+ _indexToFolder(aIndex) {
switch (aIndex) {
case 0:
- return await this._getDownloadsFolder("Desktop");
+ return this._getDownloadsFolder("Desktop");
case 1:
- return await this._getDownloadsFolder("Downloads");
+ return this._getDownloadsFolder("Downloads");
}
var currentDirPref = document.getElementById("browser.download.dir");
return currentDirPref.value;
},
/**
* Hide/show the "Show my windows and tabs from last time" option based
* on the value of the browser.privatebrowsing.autostart pref.
--- a/browser/experiments/Experiments.jsm
+++ b/browser/experiments/Experiments.jsm
@@ -1756,31 +1756,31 @@ Experiments.ExperimentEntry.prototype =
return true;
},
/*
* Start running the experiment.
*
* @return Promise<> Resolved when the operation is complete.
*/
- async start() {
+ start() {
this._log.trace("start() for " + this.id);
this._enabled = true;
- return await this.reconcileAddonState();
+ return this.reconcileAddonState();
},
// Async install of the addon for this experiment, part of the start task above.
async _installAddon() {
let hash = this._policy.ignoreHashes ? null : this._manifestData.xpiHash;
let install = await addonInstallForURL(this._manifestData.xpiURL, hash);
gActiveInstallURLs.add(install.sourceURI.spec);
- return await new Promise((resolve, reject) => {
+ return new Promise((resolve, reject) => {
let failureHandler = (failureInstall, handler) => {
let message = "AddonInstall " + handler + " for " + this.id + ", state=" +
(failureInstall.state || "?") + ", error=" + failureInstall.error;
this._log.error("_installAddon() - " + message);
this._failedStart = true;
gActiveInstallURLs.delete(failureInstall.sourceURI.spec);
TelemetryLog.log(TELEMETRY_LOG.ACTIVATION_KEY,
--- a/browser/extensions/shield-recipe-client/lib/ClientEnvironment.jsm
+++ b/browser/extensions/shield-recipe-client/lib/ClientEnvironment.jsm
@@ -31,21 +31,21 @@ let _classifyRequest = null;
this.ClientEnvironment = {
/**
* Fetches information about the client that is calculated on the server,
* like geolocation and the current time.
*
* The server request is made lazily and is cached for the entire browser
* session.
*/
- async getClientClassification() {
+ getClientClassification() {
if (!_classifyRequest) {
_classifyRequest = NormandyApi.classifyClient();
}
- return await _classifyRequest;
+ return _classifyRequest;
},
clearClassifyCache() {
_classifyRequest = null;
},
/**
* Test wrapper that mocks the server request for classifying the client.
--- a/browser/extensions/shield-recipe-client/lib/NormandyApi.jsm
+++ b/browser/extensions/shield-recipe-client/lib/NormandyApi.jsm
@@ -133,20 +133,20 @@ this.NormandyApi = {
/**
* Fetch an array of available actions from the server.
* @resolves {Array}
*/
async fetchActions() {
const actionApiUrl = await this.getApiUrl("action-list");
const res = await this.get(actionApiUrl);
- return await res.json();
+ return res.json();
},
async fetchImplementation(action) {
const response = await fetch(action.implementation_url);
if (response.ok) {
- return await response.text();
+ return response.text();
}
throw new Error(`Failed to fetch action implementation for ${action.name}: ${response.status}`);
},
};
--- a/browser/modules/ReaderParent.jsm
+++ b/browser/modules/ReaderParent.jsm
@@ -117,17 +117,17 @@ var ReaderParent = {
* Gets an article for a given URL. This method will download and parse a document.
*
* @param url The article URL.
* @param browser The browser where the article is currently loaded.
* @return {Promise}
* @resolves JS object representing the article, or null if no article is found.
*/
async _getArticle(url, browser) {
- return await ReaderMode.downloadAndParseDocument(url).catch(e => {
+ return ReaderMode.downloadAndParseDocument(url).catch(e => {
if (e && e.newURL) {
// Pass up the error so we can navigate the browser in question to the new URL:
throw e;
}
Cu.reportError("Error downloading and parsing document: " + e);
return null;
});
}
--- a/dom/indexedDB/test/head.js
+++ b/dom/indexedDB/test/head.js
@@ -77,17 +77,17 @@ function dismissNotification(popup)
}
function setFinishedCallback(callback, win)
{
if (!win) {
win = window;
}
ContentTask.spawn(win.gBrowser.selectedBrowser, null, async function() {
- return await new Promise(resolve => {
+ return new Promise(resolve => {
content.wrappedJSObject.testFinishedCallback = (result, exception) => {
info("got finished callback");
resolve({result, exception});
};
});
}).then(({result, exception}) => {
callback(result, exception);
});
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -523,21 +523,21 @@ class RTCPeerConnection {
// Don't _checkClosed() inside the chain, because it throws, and spec
// behavior is to NOT reject outstanding promises on close. This is what
// happens most of the time anyways, as the c++ code stops calling us once
// closed, hanging the chain. However, c++ may already have queued tasks
// on us, so if we're one of those then sit back.
if (this._closed) {
return null;
}
- return await func();
+ return func();
})();
// don't propagate errors in the operations chain (this is a fork of p).
this._operationsChain = p.catch(() => {});
- return await p;
+ return p;
}
// It's basically impossible to use async directly in JSImplemented code,
// because the implicit promise must be wrapped to the right type for content.
//
// The _async wrapper takes care of this. The _legacy wrapper implements
// legacy callbacks in a manner that produces correct line-numbers in errors,
// provided that methods validate their inputs before putting themselves on
@@ -759,17 +759,17 @@ class RTCPeerConnection {
return this._legacy(optionsOrOnSucc, onErr, () => this._createOffer(options));
}
return this._async(() => this._createOffer(optionsOrOnSucc));
}
async _createOffer(options) {
this._checkClosed();
let origin = Cu.getWebIDLCallerPrincipal().origin;
- return await this._chain(async () => {
+ return this._chain(async () => {
let haveAssertion;
if (this._localIdp.enabled) {
haveAssertion = this._getIdentityAssertion(origin);
}
await this._getPermission();
await this._certificateReady;
let sdp = await new Promise((resolve, reject) => {
this._onCreateOfferSuccess = resolve;
@@ -790,17 +790,17 @@ class RTCPeerConnection {
return this._legacy(optionsOrOnSucc, onErr, () => this._createAnswer({}));
}
return this._async(() => this._createAnswer(optionsOrOnSucc));
}
async _createAnswer(options) {
this._checkClosed();
let origin = Cu.getWebIDLCallerPrincipal().origin;
- return await this._chain(async () => {
+ return this._chain(async () => {
// We give up line-numbers in errors by doing this here, but do all
// state-checks inside the chain, to support the legacy feature that
// callers don't have to wait for setRemoteDescription to finish.
if (!this.remoteDescription) {
throw new this._win.DOMException("setRemoteDescription not called",
"InvalidStateError");
}
if (this.remoteDescription.type != "offer") {
@@ -841,17 +841,17 @@ class RTCPeerConnection {
let chrome = new CreateOfferRequest(outerId, this._winID,
this._globalPCListId, false);
let request = this._win.CreateOfferRequest._create(this._win, chrome);
Services.obs.notifyObservers(request, "PeerConnection:request");
});
}
}
- return await this._havePermission;
+ return this._havePermission;
}
setLocalDescription(desc, onSucc, onErr) {
return this._auto(onSucc, onErr, () => this._setLocalDescription(desc));
}
async _setLocalDescription({ type, sdp }) {
this._checkClosed();
@@ -870,17 +870,17 @@ class RTCPeerConnection {
}
if (!sdp && action != Ci.IPeerConnection.kActionRollback) {
throw new this._win.DOMException(
"Empty or null SDP provided to setLocalDescription",
"InvalidParameterError");
}
- return await this._chain(async () => {
+ return this._chain(async () => {
await this._getPermission();
await new Promise((resolve, reject) => {
this._onSetLocalDescriptionSuccess = resolve;
this._onSetLocalDescriptionFailure = reject;
this._impl.setLocalDescription(action, sdp);
});
});
}
@@ -953,17 +953,17 @@ class RTCPeerConnection {
throw new this._win.DOMException(
"Empty or null SDP provided to setRemoteDescription",
"InvalidParameterError");
}
// Get caller's origin before hitting the promise chain
let origin = Cu.getWebIDLCallerPrincipal().origin;
- return await this._chain(async () => {
+ return this._chain(async () => {
let haveSetRemote = (async () => {
await this._getPermission();
await new Promise((resolve, reject) => {
this._onSetRemoteDescriptionSuccess = resolve;
this._onSetRemoteDescriptionFailure = reject;
this._impl.setRemoteDescription(action, sdp);
});
this._updateCanTrickle();
@@ -979,17 +979,17 @@ class RTCPeerConnection {
setIdentityProvider(provider, protocol, username) {
this._checkClosed();
this._localIdp.setIdentityProvider(provider, protocol, username);
}
async _getIdentityAssertion(origin) {
await this._certificateReady;
- return await this._localIdp.getIdentityAssertion(this._impl.fingerprint, origin);
+ return this._localIdp.getIdentityAssertion(this._impl.fingerprint, origin);
}
getIdentityAssertion() {
this._checkClosed();
let origin = Cu.getWebIDLCallerPrincipal().origin;
return this._win.Promise.resolve(this._chain(() =>
this._getIdentityAssertion(origin)));
}
@@ -1034,17 +1034,17 @@ class RTCPeerConnection {
async _addIceCandidate({ candidate, sdpMid, sdpMLineIndex }) {
this._checkClosed();
if (sdpMid === null && sdpMLineIndex === null) {
throw new this._win.DOMException(
"Invalid candidate (both sdpMid and sdpMLineIndex are null).",
"TypeError");
}
- return await this._chain(() => {
+ return this._chain(() => {
if (!this.remoteDescription) {
throw new this._win.DOMException(
"setRemoteDescription needs to called before addIceCandidate",
"InvalidStateError");
}
return new Promise((resolve, reject) => {
this._onAddIceCandidateSuccess = resolve;
this._onAddIceCandidateError = reject;
@@ -1090,17 +1090,17 @@ class RTCPeerConnection {
}
_getDTMFToneBuffer(sender) {
return this._impl.getDTMFToneBuffer(sender.__DOM_IMPL__);
}
async _replaceTrack(sender, withTrack) {
this._checkClosed();
- return await this._chain(() => new Promise((resolve, reject) => {
+ return this._chain(() => new Promise((resolve, reject) => {
this._onReplaceTrackSender = sender;
this._onReplaceTrackWithTrack = withTrack;
this._onReplaceTrackSuccess = resolve;
this._onReplaceTrackFailure = reject;
this._impl.replaceTrack(sender.track, withTrack);
}));
}
@@ -1237,17 +1237,17 @@ class RTCPeerConnection {
this._warnDeprecatedStatsCallbacksNullable.warn();
this._warnDeprecatedStatsCallbacksNullable.warn = null;
}
return this._auto(onSucc, onErr, () => this._getStats(selector, isLegacy));
}
async _getStats(selector, isLegacy) {
// getStats is allowed even in closed state.
- return await this._chain(() => new Promise((resolve, reject) => {
+ return this._chain(() => new Promise((resolve, reject) => {
this._onGetStatsIsLegacy = isLegacy;
this._onGetStatsSuccess = resolve;
this._onGetStatsFailure = reject;
this._impl.getStats(selector);
}));
}
createDataChannel(label, {
--- a/services/common/kinto-storage-adapter.js
+++ b/services/common/kinto-storage-adapter.js
@@ -243,17 +243,17 @@ class FirefoxAdapter extends Kinto.adapt
*
* @returns SqliteConnection
*/
static async openConnection(options) {
const opts = Object.assign({}, { sharedMemoryCache: false }, options);
const conn = await Sqlite.openConnection(opts).then(this._init);
try {
Sqlite.shutdown.addBlocker("Kinto storage adapter connection closing",
- async () => await conn.close());
+ () => conn.close());
} catch (e) {
// It's too late to block shutdown, just close the connection.
await conn.close();
throw e;
}
return conn;
}
--- a/services/sync/tests/unit/test_bookmark_duping.js
+++ b/services/sync/tests/unit/test_bookmark_duping.js
@@ -46,17 +46,17 @@ async function cleanup(server) {
async function syncIdToId(syncId) {
let guid = await PlacesSyncUtils.bookmarks.syncIdToGuid(syncId);
return PlacesUtils.promiseItemId(guid);
}
async function getFolderChildrenIDs(folderId) {
let folderSyncId = PlacesSyncUtils.bookmarks.guidToSyncId(await PlacesUtils.promiseItemGuid(folderId));
let syncIds = await PlacesSyncUtils.bookmarks.fetchChildSyncIds(folderSyncId);
- return Promise.all(syncIds.map(async (syncId) => await syncIdToId(syncId)));
+ return Promise.all(syncIds.map((syncId) => syncIdToId(syncId)));
}
async function createFolder(parentId, title) {
let parentGuid = await PlacesUtils.promiseItemGuid(parentId);
let folder = await bms.insert({ type: bms.TYPE_FOLDER, parentGuid, title, index: 0 });
let id = await PlacesUtils.promiseItemId(folder.guid);
return { id, guid: folder.guid };
}
--- a/toolkit/components/extensions/ExtensionPreferencesManager.jsm
+++ b/toolkit/components/extensions/ExtensionPreferencesManager.jsm
@@ -305,11 +305,11 @@ this.ExtensionPreferencesManager = {
* Resolves to the level of control of the extension over the setting.
*/
async getLevelOfControl(extension, name) {
for (let prefName of settingsMap.get(name).prefNames) {
if (Preferences.locked(prefName)) {
return "not_controllable";
}
}
- return await ExtensionSettingsStore.getLevelOfControl(extension, STORE_TYPE, name);
+ return ExtensionSettingsStore.getLevelOfControl(extension, STORE_TYPE, name);
},
};
--- a/toolkit/components/extensions/ExtensionSettingsStore.jsm
+++ b/toolkit/components/extensions/ExtensionSettingsStore.jsm
@@ -261,18 +261,18 @@ this.ExtensionSettingsStore = {
* @param {string} key
* A string that uniquely identifies the setting.
*
* @returns {object | null}
* Either an object with properties for key and value, which
* corresponds to the current top precedent setting, or null if
* the current top precedent setting has not changed.
*/
- async removeSetting(extension, type, key) {
- return await alterSetting(extension, type, key, "remove");
+ removeSetting(extension, type, key) {
+ return alterSetting(extension, type, key, "remove");
},
/**
* Enables a setting in the store, possibly returning the current top
* precedent setting.
*
* @param {Extension} extension
* The extension for which a setting is being enabled.
@@ -281,18 +281,18 @@ this.ExtensionSettingsStore = {
* @param {string} key
* A string that uniquely identifies the setting.
*
* @returns {object | null}
* Either an object with properties for key and value, which
* corresponds to the current top precedent setting, or null if
* the current top precedent setting has not changed.
*/
- async enable(extension, type, key) {
- return await alterSetting(extension, type, key, "enable");
+ enable(extension, type, key) {
+ return alterSetting(extension, type, key, "enable");
},
/**
* Disables a setting in the store, possibly returning the current top
* precedent setting.
*
* @param {Extension} extension
* The extension for which a setting is being disabled.
@@ -301,18 +301,18 @@ this.ExtensionSettingsStore = {
* @param {string} key
* A string that uniquely identifies the setting.
*
* @returns {object | null}
* Either an object with properties for key and value, which
* corresponds to the current top precedent setting, or null if
* the current top precedent setting has not changed.
*/
- async disable(extension, type, key) {
- return await alterSetting(extension, type, key, "disable");
+ disable(extension, type, key) {
+ return alterSetting(extension, type, key, "disable");
},
/**
* Retrieves all settings from the store for a given extension.
*
* @param {Extension} extension The extension for which a settings are being retrieved.
* @param {string} type The type of setting to be returned.
*
@@ -335,18 +335,18 @@ this.ExtensionSettingsStore = {
* Retrieves a setting from the store, returning the current top precedent
* setting for the key.
*
* @param {string} type The type of setting to be returned.
* @param {string} key A string that uniquely identifies the setting.
*
* @returns {object} An object with properties for key and value.
*/
- async getSetting(type, key) {
- return await getTopItem(type, key);
+ getSetting(type, key) {
+ return getTopItem(type, key);
},
/**
* Return the levelOfControl for a key / extension combo.
* levelOfControl is required by Google's ChromeSetting prototype which
* in turn is used by the privacy API among others.
*
* It informs a caller of the state of a setting with respect to the current
--- a/toolkit/components/extensions/ExtensionStorageSync.jsm
+++ b/toolkit/components/extensions/ExtensionStorageSync.jsm
@@ -602,17 +602,17 @@ class CryptoCollection {
async upsert(record) {
const collection = await this.getCollection();
await collection.upsert(record);
}
async sync(extensionStorageSync) {
const collection = await this.getCollection();
- return await extensionStorageSync._syncCollection(collection, {
+ return extensionStorageSync._syncCollection(collection, {
strategy: "server_wins",
});
}
/**
* Reset sync status for ALL collections by directly
* accessing the FirefoxAdapter.
*/
@@ -825,27 +825,27 @@ class ExtensionStorageSync {
* Kinto collections (including "meta" collections like the crypto
* one).
*
* @param {Collection} collection
* @param {Object} options
* Additional options to be passed to sync().
* @returns {Promise<SyncResultObject>}
*/
- async _syncCollection(collection, options) {
+ _syncCollection(collection, options) {
// FIXME: this should support syncing to self-hosted
- return await this._requestWithToken(`Syncing ${collection.name}`, async function(token) {
+ return this._requestWithToken(`Syncing ${collection.name}`, function(token) {
const allOptions = Object.assign({}, {
remote: prefStorageSyncServerURL,
headers: {
Authorization: "Bearer " + token,
},
}, options);
- return await collection.sync(allOptions);
+ return collection.sync(allOptions);
});
}
// Make a Kinto request with a current FxA token.
// If the response indicates that the token might have expired,
// retry the request.
async _requestWithToken(description, f) {
throwIfNoFxA(this._fxaService, "making remote requests from chrome.storage.sync");
@@ -856,37 +856,37 @@ class ExtensionStorageSync {
log.error(`${description}: request failed`, e);
if (e && e.response && e.response.status == 401) {
// Our token might have expired. Refresh and retry.
log.info("Token might have expired");
await this._fxaService.removeCachedOAuthToken({token: fxaToken});
const newToken = await this._fxaService.getOAuthToken(FXA_OAUTH_OPTIONS);
// If this fails too, let it go.
- return await f(newToken);
+ return f(newToken);
}
// Otherwise, we don't know how to handle this error, so just reraise.
throw e;
}
}
/**
* Helper similar to _syncCollection, but for deleting the user's bucket.
*
* @returns {Promise<void>}
*/
- async _deleteBucket() {
+ _deleteBucket() {
log.error("Deleting default bucket and everything in it");
- return await this._requestWithToken("Clearing server", async function(token) {
+ return this._requestWithToken("Clearing server", function(token) {
const headers = {Authorization: "Bearer " + token};
const kintoHttp = new KintoHttpClient(prefStorageSyncServerURL, {
headers: headers,
timeout: KINTO_REQUEST_TIMEOUT,
});
- return await kintoHttp.deleteBucket("default");
+ return kintoHttp.deleteBucket("default");
});
}
async ensureSaltsFor(keysRecord, extIds) {
const newSalts = Object.assign({}, keysRecord.salts);
for (let collectionId of extIds) {
if (newSalts[collectionId]) {
continue;
@@ -950,17 +950,17 @@ class ExtensionStorageSync {
kbHash: kbHash,
};
await this.cryptoCollection.upsert(newRecord);
const result = await this._syncKeyRing(newRecord);
if (result.resolved.length != 0) {
// We had a conflict which was automatically resolved. We now
// have a new keyring which might have keys for the
// collections. Recurse.
- return await this.ensureCanSync(extIds);
+ return this.ensureCanSync(extIds);
}
// No conflicts. We're good.
return newKeys;
}
/**
* Update the kB in the crypto record.
@@ -1093,17 +1093,17 @@ class ExtensionStorageSync {
if (isSessionValid) {
log.error("Couldn't decipher old keyring; deleting the default bucket and resetting sync status");
await this._deleteBucket();
await this.cryptoCollection.resetSyncStatus();
// Reupload our keyring, which is the only new keyring.
// We don't want client_wins here because another device
// could have uploaded another keyring in the meantime.
- return await this.cryptoCollection.sync(this);
+ return this.cryptoCollection.sync(this);
}
}
throw e;
}
}
/**
* Get the collection for an extension, and register the extension
--- a/toolkit/components/extensions/ext-privacy.js
+++ b/toolkit/components/extensions/ext-privacy.js
@@ -23,24 +23,24 @@ const getPrivacyAPI = (extension, name,
return {
levelOfControl: details.incognito ?
"not_controllable" :
await ExtensionPreferencesManager.getLevelOfControl(
extension, name),
value: await callback(),
};
},
- async set(details) {
+ set(details) {
checkScope(details.scope);
- return await ExtensionPreferencesManager.setSetting(
+ return ExtensionPreferencesManager.setSetting(
extension, name, details.value);
},
- async clear(details) {
+ clear(details) {
checkScope(details.scope);
- return await ExtensionPreferencesManager.removeSetting(
+ return ExtensionPreferencesManager.removeSetting(
extension, name);
},
};
};
// Add settings objects for supported APIs to the preferences manager.
ExtensionPreferencesManager.addSetting("network.networkPredictionEnabled", {
prefNames: [
--- a/toolkit/components/extensions/test/xpcshell/test_ext_schemas_async.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_schemas_async.js
@@ -144,34 +144,34 @@ add_task(async function testParameterVal
assertNoThrows("async_optional", cb);
assertThrows("async_optional", cb, null);
assertThrows("async_optional", cb, cb);
}
});
add_task(async function testAsyncResults() {
await Schemas.load("data:," + JSON.stringify(schemaJson));
- async function runWithCallback(func) {
+ function runWithCallback(func) {
do_print(`Calling testnamespace.${func.name}, expecting callback with result`);
- return await new Promise(resolve => {
+ return new Promise(resolve => {
let result = "uninitialized value";
let returnValue = func(reply => {
result = reply;
resolve(result);
});
// When a callback is given, the return value must be missing.
do_check_eq(returnValue, undefined);
// Callback must be called asynchronously.
do_check_eq(result, "uninitialized value");
});
}
- async function runFailCallback(func) {
+ function runFailCallback(func) {
do_print(`Calling testnamespace.${func.name}, expecting callback with error`);
- return await new Promise(resolve => {
+ return new Promise(resolve => {
func(reply => {
do_check_eq(reply, undefined);
resolve(context.lastError.message); // eslint-disable-line no-undef
});
});
}
for (let isChromeCompat of [true, false]) {
--- a/toolkit/components/places/Bookmarks.jsm
+++ b/toolkit/components/places/Bookmarks.jsm
@@ -829,19 +829,17 @@ var Bookmarks = Object.freeze({
}
if (!typeof numberOfItems === "number" || (numberOfItems % 1) !== 0) {
throw new Error("numberOfItems argument must be an integer");
}
if (numberOfItems <= 0) {
throw new Error("numberOfItems argument must be greater than zero");
}
- return (async function() {
- return await fetchRecentBookmarks(numberOfItems);
- })();
+ return fetchRecentBookmarks(numberOfItems);
},
/**
* Fetches information about a bookmark-item.
*
* REMARK: any successful call to this method resolves to a single
* bookmark-item (or null), even when multiple bookmarks may exist
* (e.g. fetching by url). If you wish to retrieve all of the
--- a/toolkit/components/places/PlacesTransactions.jsm
+++ b/toolkit/components/places/PlacesTransactions.jsm
@@ -1024,19 +1024,19 @@ async function createItemsFromBookmarksT
if (shouldResetLastModified) {
let lastModified = PlacesUtils.toDate(item.lastModified);
await PlacesUtils.bookmarks.update({ guid, lastModified });
}
return guid;
}
- return await createItem(tree,
- tree.parentGuid,
- tree.index);
+ return createItem(tree,
+ tree.parentGuid,
+ tree.index);
}
/** ***************************************************************************
* The Standard Places Transactions.
*
* See the documentation at the top of this file. The valid values for input
* are also documented there.
*****************************************************************************/
--- a/toolkit/components/places/tests/bookmarks/test_sync_fields.js
+++ b/toolkit/components/places/tests/bookmarks/test_sync_fields.js
@@ -122,21 +122,21 @@ class TestCases {
await checkSyncFields(guid, { syncChangeCounter: 5 });
await this.removeKeyword(guid, "keyword");
do_print(`Removed keyword from bookmark ${guid}`);
await checkSyncFields(guid, { syncChangeCounter: 6 });
}
async testSeparators() {
- let insertSyncedBookmark = async uri => {
- return await this.insertBookmark(PlacesUtils.bookmarks.unfiledGuid,
- NetUtil.newURI(uri),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "A bookmark name");
+ let insertSyncedBookmark = uri => {
+ return this.insertBookmark(PlacesUtils.bookmarks.unfiledGuid,
+ NetUtil.newURI(uri),
+ PlacesUtils.bookmarks.DEFAULT_INDEX,
+ "A bookmark name");
};
await insertSyncedBookmark("http://foo.bar");
let secondBmk = await insertSyncedBookmark("http://bar.foo");
let sepGuid = await this.insertSeparator(PlacesUtils.bookmarks.unfiledGuid, PlacesUtils.bookmarks.DEFAULT_INDEX);
await insertSyncedBookmark("http://barbar.foo");
do_print("Move a bookmark around the separator");
@@ -248,29 +248,29 @@ class TestCases {
}
// Exercises the legacy, synchronous `nsINavBookmarksService` calls implemented
// in C++.
class SyncTestCases extends TestCases {
async createFolder(parentGuid, title, index) {
let parentId = await PlacesUtils.promiseItemId(parentGuid);
let id = PlacesUtils.bookmarks.createFolder(parentId, title, index);
- return await PlacesUtils.promiseItemGuid(id);
+ return PlacesUtils.promiseItemGuid(id);
}
async insertBookmark(parentGuid, uri, index, title) {
let parentId = await PlacesUtils.promiseItemId(parentGuid);
let id = PlacesUtils.bookmarks.insertBookmark(parentId, uri, index, title);
- return await PlacesUtils.promiseItemGuid(id);
+ return PlacesUtils.promiseItemGuid(id);
}
async insertSeparator(parentGuid, index) {
let parentId = await PlacesUtils.promiseItemId(parentGuid);
let id = PlacesUtils.bookmarks.insertSeparator(parentId, index);
- return await PlacesUtils.promiseItemGuid(id);
+ return PlacesUtils.promiseItemGuid(id);
}
async moveItem(guid, newParentGuid, index) {
let id = await PlacesUtils.promiseItemId(guid);
let newParentId = await PlacesUtils.promiseItemId(newParentGuid);
PlacesUtils.bookmarks.moveItem(id, newParentId, index);
}
--- a/toolkit/components/places/tests/history/test_removeByFilter.js
+++ b/toolkit/components/places/tests/history/test_removeByFilter.js
@@ -141,23 +141,23 @@ add_task(async function test_removeByFil
if (bookmarkUse) {
bookmarkedUri = (arr) => arr[0];
checkableArray = (arr) => arr.slice(1);
checkClosure = function(aUri) { };
}
// Case A 1: Dates
await removeByFilterTester(sameHostVisits,
{ beginDate: new Date(2004, 1, 1), endDate: new Date(2006, 1, 1) },
- async () => await assertInDB(remoteUriList[0]),
- async () => await checkClosure(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
+ () => checkClosure(remoteUriList[0]),
callbackUse, bookmarkedUri(remoteUriList));
// Case A 2: Single Sub-host
await removeByFilterTester(sameHostVisits, { host: "mozilla.org" },
- async () => await assertInDB(remoteUriList[0]),
- async () => await checkClosure(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
+ () => checkClosure(remoteUriList[0]),
callbackUse, bookmarkedUri(remoteUriList));
// Case A 3: Multiple subhost
await removeByFilterTester(randomHostVisits, { host: "*.mozilla.org" },
async () => { for (let uri of remoteUriList) await assertInDB(uri); },
async () => { for (let uri of checkableArray(remoteUriList)) await checkClosure(uri) },
callbackUse, bookmarkedUri(remoteUriList));
}
@@ -171,38 +171,38 @@ add_task(async function test_removeByFil
async () => { for (let uri of fileUriList) await assertInDB(uri) },
async () => { for (let uri of fileUriList) await assertNotInDB(uri) },
callbackUse);
// Case B: Tests which do not remove anything (inverses)
// Case B 1: Date
await removeByFilterTester(sameHostVisits,
{ beginDate: new Date(2001, 1, 1), endDate: new Date(2002, 1, 1) },
- async () => await assertInDB(remoteUriList[0]),
- async () => await assertInDB(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
callbackUse);
// Case B 2 : Single subhost
await removeByFilterTester(sameHostVisits, { host: "notthere.org" },
- async () => await assertInDB(remoteUriList[0]),
- async () => await assertInDB(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
callbackUse);
// Case B 3 : Multiple subhosts
await removeByFilterTester(randomHostVisits, { host: "*.notthere.org" },
async () => { for (let uri of remoteUriList) await assertInDB(uri) },
async () => { for (let uri of remoteUriList) await assertInDB(uri) },
callbackUse);
// Case C: Combination Cases
// Case C 1: single subhost
await removeByFilterTester(sameHostVisits,
{ host: "mozilla.org",
beginDate: new Date(2004, 1, 1),
endDate: new Date(2006, 1, 1) },
- async () => await assertInDB(remoteUriList[0]),
- async () => await assertNotInDB(remoteUriList[0]),
+ () => assertInDB(remoteUriList[0]),
+ () => assertNotInDB(remoteUriList[0]),
callbackUse);
// Case C 2: multiple subhost
await removeByFilterTester(randomHostVisits,
{ host: "*.mozilla.org",
beginDate: new Date(2005, 1, 1),
endDate: new Date(2017, 1, 1) },
async () => { for (let uri of remoteUriList) await assertInDB(uri) },
async () => { for (let uri of remoteUriList) await assertNotInDB(uri) },
--- a/toolkit/components/places/tests/migration/test_current_from_v34.js
+++ b/toolkit/components/places/tests/migration/test_current_from_v34.js
@@ -46,17 +46,17 @@ function insertBookmark(db, info) {
let url = new URL(info.url);
let placeGuid = makeGuid();
await db.execute(`
INSERT INTO moz_places (url, rev_host, hidden, frecency, guid)
VALUES (:url, :rev_host, 0, -1, :guid)`,
{ url: url.href, guid: placeGuid,
rev_host: PlacesUtils.getReversedHost(url) });
}
- return await insertItem(db, info);
+ return insertItem(db, info);
});
}
async function insertAnno(db, itemId, name, value) {
await db.execute(`INSERT OR IGNORE INTO moz_anno_attributes (name)
VALUES (:name)`, { name });
await db.execute(`
INSERT INTO moz_items_annos
--- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
+++ b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
@@ -432,24 +432,24 @@ function makeExtensionMatch(extra = {})
function makeTestServer(port = -1) {
let httpServer = new HttpServer();
httpServer.start(port);
do_register_cleanup(() => httpServer.stop(() => {}));
return httpServer;
}
-async function addTestEngine(basename, httpServer = undefined) {
+function addTestEngine(basename, httpServer = undefined) {
httpServer = httpServer || makeTestServer();
httpServer.registerDirectory("/", do_get_cwd());
let dataUrl =
"http://localhost:" + httpServer.identity.primaryPort + "/data/";
do_print("Adding engine: " + basename);
- return await new Promise(resolve => {
+ return new Promise(resolve => {
Services.obs.addObserver(function obs(subject, topic, data) {
let engine = subject.QueryInterface(Ci.nsISearchEngine);
do_print("Observed " + data + " for " + engine.name);
if (data != "engine-added" || engine.name != basename) {
return;
}
Services.obs.removeObserver(obs, "browser-search-engine-modified");
--- a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
+++ b/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
@@ -151,20 +151,20 @@ async function new_bookmark(aInfo) {
aInfo.url = uri("http://test.item." + itemsCount);
if (!("title" in aInfo))
aInfo.title = "Test Item (bookmark) " + itemsCount;
await PlacesTransactions.NewBookmark(aInfo).transact();
}
-async function new_folder(aInfo) {
+function new_folder(aInfo) {
if (!("title" in aInfo))
aInfo.title = "Test Item (folder) " + itemsCount;
- return await PlacesTransactions.NewFolder(aInfo).transact();
+ return PlacesTransactions.NewFolder(aInfo).transact();
}
// Walks a result nodes tree and test promiseBookmarksTree for each node.
// DO NOT COPY THIS LOGIC: It is done here to accomplish a more comprehensive
// test of the API (the entire hierarchy data is available in the very test).
async function test_promiseBookmarksTreeForEachNode(aNode, aOptions, aExcludedGuids) {
Assert.ok(aNode.bookmarkGuid && aNode.bookmarkGuid.length > 0);
let item = await PlacesUtils.promiseBookmarksTree(aNode.bookmarkGuid, aOptions);
@@ -185,17 +185,17 @@ async function test_promiseBookmarksTree
}
async function test_promiseBookmarksTreeAgainstResult(aItemGuid = "",
aOptions = { includeItemIds: true },
aExcludedGuids) {
let itemId = aItemGuid ?
await PlacesUtils.promiseItemId(aItemGuid) : PlacesUtils.placesRootId;
let node = PlacesUtils.getFolderContents(itemId).root;
- return await test_promiseBookmarksTreeForEachNode(node, aOptions, aExcludedGuids);
+ return test_promiseBookmarksTreeForEachNode(node, aOptions, aExcludedGuids);
}
add_task(async function() {
// Add some bookmarks to cover various use cases.
await new_bookmark({ parentGuid: PlacesUtils.bookmarks.toolbarGuid });
await new_folder({ parentGuid: PlacesUtils.bookmarks.menuGuid,
annotations: [{ name: "TestAnnoA", value: "TestVal" },
{ name: "TestAnnoB", value: 0 }]});
--- a/toolkit/components/reader/ReaderMode.jsm
+++ b/toolkit/components/reader/ReaderMode.jsm
@@ -219,40 +219,40 @@ this.ReaderMode = {
/**
* Gets an article from a loaded browser's document. This method will not attempt
* to parse certain URIs (e.g. about: URIs).
*
* @param doc A document to parse.
* @return {Promise}
* @resolves JS object representing the article, or null if no article is found.
*/
- async parseDocument(doc) {
+ parseDocument(doc) {
if (!this._shouldCheckUri(doc.documentURIObject) || !this._shouldCheckUri(doc.baseURIObject, true)) {
this.log("Reader mode disabled for URI");
return null;
}
- return await this._readerParse(doc);
+ return this._readerParse(doc);
},
/**
* Downloads and parses a document from a URL.
*
* @param url URL to download and parse.
* @return {Promise}
* @resolves JS object representing the article, or null if no article is found.
*/
async downloadAndParseDocument(url) {
let doc = await this._downloadDocument(url);
if (!this._shouldCheckUri(doc.documentURIObject) || !this._shouldCheckUri(doc.baseURIObject, true)) {
this.log("Reader mode disabled for URI");
return null;
}
- return await this._readerParse(doc);
+ return this._readerParse(doc);
},
_downloadDocument(url) {
let histogram = Services.telemetry.getHistogramById("READER_MODE_DOWNLOAD_RESULT");
return new Promise((resolve, reject) => {
let xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.onerror = evt => reject(evt.error);
--- a/toolkit/components/viewsource/test/browser/head.js
+++ b/toolkit/components/viewsource/test/browser/head.js
@@ -71,27 +71,27 @@ function waitForViewSourceWindow() {
}
/**
* Opens view source for a browser.
*
* @param browser - the <xul:browser> to open view source for.
* @returns the new tab or window which shows the source.
*/
-async function openViewSource(browser) {
+function openViewSource(browser) {
let openPromise;
if (Services.prefs.getBoolPref("view_source.tab")) {
openPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
} else {
openPromise = waitForViewSourceWindow();
}
window.BrowserViewSource(browser);
- return (await openPromise);
+ return openPromise;
}
/**
* Opens a view source tab / window for a selection (View Selection Source)
* within the currently selected browser in gBrowser.
*
* @param aCSSSelector - used to specify a node within the selection to
* view the source of. It is expected that this node is
@@ -115,17 +115,17 @@ async function openViewPartialSource(aCS
}
let popupHiddenPromise =
BrowserTestUtils.waitForEvent(contentAreaContextMenuPopup, "popuphidden");
let item = document.getElementById("context-viewpartialsource-selection");
EventUtils.synthesizeMouseAtCenter(item, {});
await popupHiddenPromise;
- return (await openPromise);
+ return openPromise;
}
/**
* Opens a view source tab for a frame (View Frame Source) within the
* currently selected browser in gBrowser.
*
* @param aCSSSelector - used to specify the frame to view the source of.
* @returns the new tab which shows the source.
@@ -148,17 +148,17 @@ async function openViewFrameSourceTab(aC
let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
let popupHiddenPromise =
BrowserTestUtils.waitForEvent(frameContextMenu, "popuphidden");
let item = document.getElementById("context-viewframesource");
EventUtils.synthesizeMouseAtCenter(item, {});
await popupHiddenPromise;
- return (await newTabPromise);
+ return newTabPromise;
}
registerCleanupFunction(function() {
var windows = Services.wm.getEnumerator(WINDOW_TYPE);
ok(!windows.hasMoreElements(), "No remaining view source windows still open");
while (windows.hasMoreElements())
windows.getNext().close();
});
--- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js
@@ -259,16 +259,19 @@ module.exports = {
"no-octal": "error",
// No redeclaring variables
"no-redeclare": "error",
// Disallow multiple spaces in regular expressions
"no-regex-spaces": "error",
+ // Disallows unnecessary `return await ...`.
+ "no-return-await": "error",
+
// Disallow assignments where both sides are exactly the same
"no-self-assign": "error",
// No unnecessary comparisons
"no-self-compare": "error",
// No declaring variables from an outer scope
// "no-shadow": "error",