Skip to content

Commit

Permalink
test: update test-domain-uncaught-exception.js
Browse files Browse the repository at this point in the history
file: test/parallel/test-domain-uncaught-exception.js

1. There are three setTimeout() in the file and they do not specify a
duration (the second argument), so I change them to setImmediate()
instead.

2. There are four callbacks that take an argument called `err` but that
argument is never used, so I removed them.

PR-URL: #10193
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
  • Loading branch information
amazingandyyy authored and MylesBorins committed Dec 15, 2016
1 parent 60542cb commit 308cead
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions test/parallel/test-domain-uncaught-exception.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function test1() {
d.run(function() {
setTimeout(function onTimeout() {
throw new Error('boom!');
});
}, 1);
});
}

Expand Down Expand Up @@ -59,7 +59,7 @@ function test3() {
const d3 = domain.create();
const d4 = domain.create();

d3.on('error', function onErrorInD3Domain(err) {
d3.on('error', function onErrorInD3Domain() {
process.send('errorHandledByDomain');
});

Expand Down Expand Up @@ -88,15 +88,15 @@ function test4() {
const d5 = domain.create();
const d6 = domain.create();

d5.on('error', function onErrorInD2Domain(err) {
d5.on('error', function onErrorInD2Domain() {
process.send('errorHandledByDomain');
});

d5.run(function() {
d6.run(function() {
setTimeout(function onTimeout() {
throw new Error('boom!');
});
}, 1);
});
});
}
Expand All @@ -115,7 +115,7 @@ function test5() {
const d7 = domain.create();
const d8 = domain.create();

d8.on('error', function onErrorInD3Domain(err) {
d8.on('error', function onErrorInD3Domain() {
process.send('errorHandledByDomain');
});

Expand All @@ -139,15 +139,15 @@ function test6() {
const d9 = domain.create();
const d10 = domain.create();

d10.on('error', function onErrorInD2Domain(err) {
d10.on('error', function onErrorInD2Domain() {
process.send('errorHandledByDomain');
});

d9.run(function() {
d10.run(function() {
setTimeout(function onTimeout() {
throw new Error('boom!');
});
}, 1);
});
});
}
Expand Down

0 comments on commit 308cead

Please sign in to comment.