mirror of
https://github.com/nodejs/node.git
synced 2025-05-10 17:57:53 +00:00

Instead of using nextTick to process failed lists, just attempt to process them again from C++ if the process is still alive. This also allows the removal of domain specific code in timers. The current behaviour is not quite ideal as it means that all lists after the failed one will process on an arbitrary nextTick, even if they're — say — not due to fire for another 2 days... PR-URL: https://github.com/nodejs/node/pull/18486 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
18 lines
357 B
JavaScript
18 lines
357 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
|
|
process.once('uncaughtException', common.expectsError({
|
|
message: 'Timeout Error'
|
|
}));
|
|
|
|
let called = false;
|
|
const t = setTimeout(() => {
|
|
assert(!called);
|
|
called = true;
|
|
t.ref();
|
|
throw new Error('Timeout Error');
|
|
}, 1).unref();
|
|
|
|
setTimeout(common.mustCall(), 1);
|