mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
test: introduce common.crashOnUnhandledRejection
Ref: https://github.com/nodejs/node/pull/12442 PR-URL: https://github.com/nodejs/node/pull/12489 Reviewed-By: Matthew Loring <mattloring@google.com> Reviewed-By: Julien Gilli <jgilli@nodejs.org> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 file changed
+6
@@ -677,3 +677,9 @@ exports.getArrayBufferViews = function getArrayBufferViews(buf) {
|
||||
}
|
||||
return out;
|
||||
};
|
||||
|
||||
// Crash the process on unhandled rejections.
|
||||
exports.crashOnUnhandledRejection = function() {
|
||||
process.on('unhandledRejection',
|
||||
(err) => process.nextTick(() => { throw err; }));
|
||||
};
|
||||
Reference in new issue
Block a user