diff --git a/dom/crypto/test/test_WebCrypto.html b/dom/crypto/test/test_WebCrypto.html index d68f15d340507..2892b217ea528 100644 --- a/dom/crypto/test/test_WebCrypto.html +++ b/dom/crypto/test/test_WebCrypto.html @@ -491,8 +491,7 @@ function doEncrypt(x) { return encrypt(x, new Uint8Array(15)) - .catch(function () { return encrypt(new Uint8Array(17)); } - ); + .catch(function () { return encrypt(new Uint8Array(17)); }); } crypto.subtle.importKey("raw", tv.aes_cbc_enc.key, "AES-CBC", false, ['encrypt']) @@ -539,8 +538,7 @@ function doDecrypt(x) { return decrypt(x, new Uint8Array(15)) - .catch(function () { return decrypt(x, new Uint8Array(17)); } - ); + .catch(function () { return decrypt(x, new Uint8Array(17)); }); } crypto.subtle.importKey("raw", tv.aes_cbc_dec.key, "AES-CBC", false, ['decrypt']) @@ -587,8 +585,7 @@ function doEncrypt(x) { return encrypt(x, new Uint8Array(15)) - .catch(function () { return encrypt(x, new Uint8Array(17)); } - ); + .catch(function () { return encrypt(x, new Uint8Array(17)); }); } crypto.subtle.importKey("raw", tv.aes_ctr_enc.key, "AES-CTR", false, ['encrypt']) @@ -635,8 +632,7 @@ function decrypt(x) { return decrypt(x, new Uint8Array(15)) - .catch(function () { return decrypt(x, new Uint8Array(17)); } - ); + .catch(function () { return decrypt(x, new Uint8Array(17)); }); } crypto.subtle.importKey("raw", tv.aes_ctr_dec.key, "AES-CTR", false, ['decrypt']) diff --git a/dom/promise/tests/unit/test_monitor_uncaught.js b/dom/promise/tests/unit/test_monitor_uncaught.js index 253a3750c1b11..8afc485931c2e 100644 --- a/dom/promise/tests/unit/test_monitor_uncaught.js +++ b/dom/promise/tests/unit/test_monitor_uncaught.js @@ -103,7 +103,7 @@ add_task(function* test_observe_uncaught() { }; yield { promise: Promise.resolve(0).catch(null), - name: "`then(null, null)`" + name: "`catch(null)`" }; yield { promise: Promise.reject(0).catch(() => {}), diff --git a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js index d03e4f62290aa..41158318529b8 100644 --- a/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js +++ b/services/fxaccounts/tests/xpcshell/test_oauth_grant_client.js @@ -106,14 +106,13 @@ add_test(function parseErrorResponse() { client._Request = new mockResponse(response); client.getTokenFromAssertion("assertion", "scope") .catch(function(e) { - do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); - do_check_eq(e.code, STATUS_SUCCESS); - do_check_eq(e.errno, ERRNO_PARSE); - do_check_eq(e.error, ERROR_PARSE); - do_check_eq(e.message, "unexpected"); - run_next_test(); - } - ); + do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); + do_check_eq(e.code, STATUS_SUCCESS); + do_check_eq(e.errno, ERRNO_PARSE); + do_check_eq(e.error, ERROR_PARSE); + do_check_eq(e.message, "unexpected"); + run_next_test(); + }); }); add_test(function serverErrorResponse() { @@ -132,8 +131,7 @@ add_test(function serverErrorResponse() { do_check_eq(e.error, "Bad Request"); do_check_eq(e.message, "Unauthorized"); run_next_test(); - } - ); + }); }); add_test(function networkErrorResponse() { @@ -144,13 +142,12 @@ add_test(function networkErrorResponse() { Services.prefs.setBoolPref("identity.fxaccounts.skipDeviceRegistration", true); client.getTokenFromAssertion("assertion", "scope") .catch(function(e) { - do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); - do_check_eq(e.code, null); - do_check_eq(e.errno, ERRNO_NETWORK); - do_check_eq(e.error, ERROR_NETWORK); - run_next_test(); - } - ).catch(() => {}).then(() => + do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); + do_check_eq(e.code, null); + do_check_eq(e.errno, ERRNO_NETWORK); + do_check_eq(e.error, ERROR_NETWORK); + run_next_test(); + }).catch(() => {}).then(() => Services.prefs.clearUserPref("identity.fxaccounts.skipDeviceRegistration")); }); @@ -159,14 +156,13 @@ add_test(function unsupportedMethod() { return client._createRequest("/", "PUT") .catch(function(e) { - do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); - do_check_eq(e.code, ERROR_CODE_METHOD_NOT_ALLOWED); - do_check_eq(e.errno, ERRNO_NETWORK); - do_check_eq(e.error, ERROR_NETWORK); - do_check_eq(e.message, ERROR_MSG_METHOD_NOT_ALLOWED); - run_next_test(); - } - ); + do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); + do_check_eq(e.code, ERROR_CODE_METHOD_NOT_ALLOWED); + do_check_eq(e.errno, ERRNO_NETWORK); + do_check_eq(e.error, ERROR_NETWORK); + do_check_eq(e.message, ERROR_MSG_METHOD_NOT_ALLOWED); + run_next_test(); + }); }); add_test(function onCompleteRequestError() { @@ -174,14 +170,13 @@ add_test(function onCompleteRequestError() { client._Request = new mockResponseError(new Error("onComplete error")); client.getTokenFromAssertion("assertion", "scope") .catch(function(e) { - do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); - do_check_eq(e.code, null); - do_check_eq(e.errno, ERRNO_NETWORK); - do_check_eq(e.error, ERROR_NETWORK); - do_check_eq(e.message, "Error: onComplete error"); - run_next_test(); - } - ); + do_check_eq(e.name, "FxAccountsOAuthGrantClientError"); + do_check_eq(e.code, null); + do_check_eq(e.errno, ERRNO_NETWORK); + do_check_eq(e.error, ERROR_NETWORK); + do_check_eq(e.message, "Error: onComplete error"); + run_next_test(); + }); }); add_test(function incorrectErrno() { @@ -200,8 +195,7 @@ add_test(function incorrectErrno() { do_check_eq(e.error, "Bad Request"); do_check_eq(e.message, "Unauthorized"); run_next_test(); - } - ); + }); }); add_test(function constructorTests() { diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm index adf20b728986d..a75383e83151c 100644 --- a/toolkit/components/osfile/modules/osfile_async_front.jsm +++ b/toolkit/components/osfile/modules/osfile_async_front.jsm @@ -376,7 +376,7 @@ var Scheduler = this.Scheduler = { // By definition, |this.queue| can never reject. this.queue = promise.catch(() => undefined); // Fork |promise| to ensure that uncaught errors are reported - return promise.catch(null); + return promise.then(); }, /** diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm index dd8c4e6f56068..dff0e68f20f91 100644 --- a/toolkit/components/places/PlacesUtils.jsm +++ b/toolkit/components/places/PlacesUtils.jsm @@ -3069,7 +3069,7 @@ PlacesCreateLivemarkTransaction.prototype = { // The getLivemark callback may fail, but it is used just to serialize, // so it doesn't matter. this._promise = PlacesUtils.livemarks.getLivemark({ id: this.item.id }) - .catch(null).then( () => { + .catch(() => {}).then(() => { PlacesUtils.bookmarks.removeItem(this.item.id); }); }