Bug 1574915 - Fix useless try-catch issues in dom/. r=hsivonen

Differential Revision: https://phabricator.services.mozilla.com/D42509

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Mark Banner 2019-08-19 17:02:54 +00:00
Родитель ca74b508b7
Коммит c1ab51f11c
6 изменённых файлов: 18 добавлений и 27 удалений

Просмотреть файл

@ -62,11 +62,7 @@
.then(
result => step(gen.next(result)),
error => {
try {
step(gen.throw(error));
} catch (err) {
throw err;
}
step(gen.throw(error));
}
)
.catch(err => reject(err));

Просмотреть файл

@ -60,8 +60,8 @@ function runTests() {
try {
test_2d_canvaspattern_setTransform();
} catch(e) {
throw e;
ok(false, "unexpected exception thrown in: test_2d_canvaspattern_setTransform");
throw e;
}
SimpleTest.finish();
}
@ -75,4 +75,3 @@ document.all;
window.p = new Path2D();
</script>

Просмотреть файл

@ -25606,14 +25606,14 @@ function runTests() {
try {
test_getImageData_after_zero_canvas();
} catch(e) {
throw e;
ok(false, "unexpected exception thrown in: test_getImageData_after_zero_canvas");
throw e;
}
try {
test_opaque();
} catch(e) {
throw e;
ok(false, "unexpected exception thrown in: test_opaque");
throw e;
}
try {
test_2d_transformation_reset_transform();
@ -25764,8 +25764,8 @@ function runTests() {
try {
test_2d_clearRect_testdoubleprecision();
} catch(e) {
throw e;
ok(false, "unexpected exception thrown in: test_2d_clearRect_testdoubleprecision");
throw e;
}
//run the asynchronous tests

Просмотреть файл

@ -60,8 +60,8 @@ function runTests() {
try {
test_drawFocusIfNeeded_canvas();
} catch(e) {
throw e;
ok(false, "unexpected exception thrown in: test_drawFocusIfNeeded_canvas");
throw e;
}
SpecialPowers.setBoolPref("canvas.focusring.enabled", false);

Просмотреть файл

@ -72,8 +72,8 @@ function runTests() {
try {
test_hitregions();
} catch(e) {
throw e;
ok(false, "unexpected exception thrown in: test_hitregions");
throw e;
}
SimpleTest.finish();
}

Просмотреть файл

@ -28,23 +28,19 @@ function ignoreError(e) {}
function CreateTestWS(ws_location, ws_protocol) {
var ws;
try {
if (ws_protocol == undefined) {
ws = new WebSocket(ws_location);
} else {
ws = new WebSocket(ws_location, ws_protocol);
}
ws._testNumber = current_test;
ok(true, "Created websocket for test " + ws._testNumber + "\n");
ws.onerror = function(e) {
ok(false, "onerror called on test " + e.target._testNumber + "!");
};
} catch (e) {
throw e;
if (ws_protocol == undefined) {
ws = new WebSocket(ws_location);
} else {
ws = new WebSocket(ws_location, ws_protocol);
}
ws._testNumber = current_test;
ok(true, "Created websocket for test " + ws._testNumber + "\n");
ws.onerror = function(e) {
ok(false, "onerror called on test " + e.target._testNumber + "!");
};
return ws;
}